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_Gloria_Villa #66

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

Scissors_Gloria_Villa #66

wants to merge 11 commits into from

Conversation

ggrossvi
Copy link

@ggrossvi ggrossvi commented Apr 7, 2021

Indents fixed.

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.

Looks great! There are just a couple notes below of things to think about and keep in mind for the future :)

Comment on lines +20 to +23
elif self.condition == 1:
desc = "Might use a glove"
elif self.condition == 0:
desc = "Make sure you really want to do this!"

Choose a reason for hiding this comment

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

Haha

Comment on lines +67 to +73
self_first_item = self.inventory[0]
vendor_first_item = vendor.inventory[0]
self.remove(self_first_item)
self.add(vendor_first_item)
vendor.remove(vendor_first_item)
vendor.add(self_first_item)
return True

Choose a reason for hiding this comment

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

This looks a whole lot like the code in the method above! I wonder if there's a way we could make use of that other method here...

return None

best_item = None
for item in 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.

Love that you made use of the existing method here!

Comment on lines +102 to +106
if other.get_by_category(my_priority) == None or self.get_by_category(their_priority)== None:
return False

my_trade_to_other = self.get_best_by_category(their_priority)
their_trade_to_me = other.get_best_by_category(my_priority)

Choose a reason for hiding this comment

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

One minor optimization here would be to store the results of self.get_best_by_category(their_priority) and other.get_best_by_category(my_priority) in variables.
When you call the methods twice, they need to do all the work twice.

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