From f1b9b758d865adc145d94b90f139b771e8287636 Mon Sep 17 00:00:00 2001 From: lex-marie790 Date: Tue, 8 Sep 2020 23:24:11 -0700 Subject: [PATCH] adv completed --- src/adv.py | 17 +++++++++++++++++ src/room.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/adv.py b/src/adv.py index c9e26b0f85..e569c39285 100644 --- a/src/adv.py +++ b/src/adv.py @@ -1,4 +1,5 @@ from room import Room +from player import Player # Declare all the rooms @@ -49,3 +50,19 @@ # Print an error message if the movement isn't allowed. # # If the user enters "q", quit the game. +directions = ['n', 's', 'e', 'w'] +player = Player(room['outside']) + +while True: + print(player.current_room.name) + print(player.current_room.description) + + user_input = input('Where would you like to go: ') + + if user_input == 'q': + print('Thanks for playing!') + break + elif user_input in directions: + player.move(user_input) + else: + print("Whoops, enter a valid command like: n, s, e, w") \ No newline at end of file diff --git a/src/room.py b/src/room.py index 24c07ad4c8..9a7d7c6b6a 100644 --- a/src/room.py +++ b/src/room.py @@ -1,2 +1,2 @@ # Implement a class to hold room information. This should have name and -# description attributes. \ No newline at end of file +# description attributes.