Repository navigation
Conversation
brianilles
self-requested a review
February 13, 2020 16:42
brianilles
approved these changes
Feb 13, 2020
| self.n_to = 'Sorry there is no room north of {}\n'.format(self.name) | ||
| self.s_to = 'Sorry there is no room south of {}\n'.format(self.name) | ||
| self.e_to = 'Sorry there is no room east of {}\n'.format(self.name) | ||
| self.w_to = 'Sorry there is no room west of {}\n'.format(self.name) |
Collaborator
There was a problem hiding this comment.
Cool initialization here
| self.w_to = 'Sorry there is no room west of {}\n'.format(self.name) | ||
| self.items = items | ||
|
|
||
| def search_item(self, item): |
Collaborator
There was a problem hiding this comment.
Nice abstraction of search_item()
|
|
||
| if character.search_inventory(user_input[1]): | ||
| reclaim_item = character.drop_item(user_input[1]) | ||
| current_room.restock_item(reclaim_item) |
Collaborator
There was a problem hiding this comment.
restock_item() excellent naming
|
|
||
| print('\nPlease use the valid inputs [n, s, e, w] to move, drop [item] and take [item], i to check inventory, or q to quit\n') | ||
|
|
||
| elif len(user_input) == 2: |
Collaborator
There was a problem hiding this comment.
Nice work! What could we do to make these if-else statements more readable?
brianilles
reviewed
Feb 14, 2020
| if len(user_input) == 1: | ||
|
|
||
| if user_input[0] == 'n' or user_input[0] == 's' or user_input[0] == 'e' or user_input[0] == 'w': | ||
| if user_input[0] in ['n','s','w','e']: |
Collaborator
There was a problem hiding this comment.
Refactor is on point. Far more readable :)
brianilles
approved these changes
Feb 14, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.