Skip to content

CS_26 Introduction Python II TL-Brian Illes - #1

Open
karsevar wants to merge 9 commits into
masterfrom
mason-karsevar
Open

karsevar wants to merge 9 commits into
masterfrom
mason-karsevar

Conversation

@karsevar

Copy link
Copy Markdown
Owner

No description provided.

@brianilles
brianilles self-requested a review February 13, 2020 16:42

@brianilles brianilles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome start!

Comment thread src/room.py
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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool initialization here

Comment thread src/room.py
self.w_to = 'Sorry there is no room west of {}\n'.format(self.name)
self.items = items

def search_item(self, item):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice abstraction of search_item()

Comment thread src/adv.py Outdated

if character.search_inventory(user_input[1]):
reclaim_item = character.drop_item(user_input[1])
current_room.restock_item(reclaim_item)

@brianilles brianilles Feb 13, 2020 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

restock_item() excellent naming

Comment thread src/adv.py

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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work! What could we do to make these if-else statements more readable?

Comment thread src/adv.py
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']:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Refactor is on point. Far more readable :)

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