Skip to content

Matthew meitl - #1

Open
mmeitl wants to merge 3 commits into
masterfrom
matthew-meitl
Open

mmeitl wants to merge 3 commits into
masterfrom
matthew-meitl

Conversation

@mmeitl

@mmeitl mmeitl commented May 30, 2019 •

Copy link
Copy Markdown
Owner

Day 1 MVP

  • Create the REPL command parser in adv.py which allows the player to move to rooms in the four cardinal directions.
  • Fill out Player and Room classes in player.py and room.py

Day 2 MVP

  • Make rooms able to hold multiple items
  • Make the player able to carry multiple items
  • Add items to the game that the user can carry around
  • Add get [ITEM_NAME] and drop [ITEM_NAME] commands to the parser

Comment thread src/room.py
self.name = name
self.description = description No newline at end of file
self.description = description
self.list = list No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I will not use the word list here as a class property name because it is a default keyword method in Python to convert an iterable object into a list.

@eddygonzalez9708

eddygonzalez9708 commented Jun 3, 2019 •

Copy link
Copy Markdown

In your grab direction function in adv.py, you need a return keyword when you recursively call grab direction again upon an invalid entry. By not having a return statement your game will crash when typing an invalid entry and then typing a valid entry.

def grab_direction():
    direction = input("\nPlease enter a direction of travel: ").lower()
    if direction in valid_directions:
        print('direction 3', direction)
        print('direction 4', type(direction))
        return direction
    else:
        print("Invalid entry! Please use 'n', 's', 'e' or 'w' to navigate\n Enter 'q' to exit the game")
        # Below I added the return keyword which fixes this issue.
        return grab_direction()

@eddygonzalez9708

Copy link
Copy Markdown

Although you have a bug in your code and did not complete Day 2 MVP tasks (player is able to get and drop items) I will approve this pull request to be merged into master. Please submit another pull request with those changes.

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