Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Scissors, Mai Truong #49

wants to merge 5 commits into from

Conversation

truongmt89
Copy link

No description provided.

Copy link

@jmaddox19 jmaddox19 left a 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!

Comment on lines +11 to +22
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."

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)

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)

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!

Comment on lines +70 to +78
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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So clean!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants