-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scissors, Mai Truong #49
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great! Very succinct, readable, and DRY!
if self.condition == 0.0: | ||
return "Are you sure you want that?" | ||
elif self.condition <= 1.0: | ||
return "Came from home with 8 kids & 3 mastiffs." | ||
elif self.condition <= 2.0: | ||
return "Could be worse?" | ||
elif self.condition <= 3.0: | ||
return "Meh..." | ||
elif self.condition <= 4.0: | ||
return "One heck of a deal!" | ||
else: | ||
return "If you don't take, it's coming home to mama." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love these 😆
if self.inventory and vendor_friend.inventory: | ||
my_item = self.inventory[0] | ||
their_item = vendor_friend.inventory[0] | ||
self.swap_items(vendor_friend, my_item, their_item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of existing method!
|
||
def get_best_by_category(self, category): | ||
|
||
list_of_items = self.get_by_category(category) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of existing method!
def swap_best_by_category(self, other, my_priority, their_priority): | ||
|
||
my_best_item = self.get_best_by_category(their_priority) | ||
their_best_item = other.get_best_by_category(my_priority) | ||
|
||
if their_best_item == None or my_best_item == None: | ||
return False | ||
else: | ||
return self.swap_items(other, my_best_item, their_best_item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So clean!
No description provided.