Pseudocode to Move Between Rooms SET current room TO supply room PRINT room with description Keep track
Question:
Pseudocode to "Move Between Rooms"
SET current room TO supply room
PRINT room with description
Keep track of valid moves for each room using data structure (list, dictionary)
Keep track of all items in each room using a data structure
Keep track of player's inventory with a list
While true:
Player choose direction and take item
Player can select to move either North, South, East or West (N, S, E, W)
Player can select to take item mask, medication, hand sanitizer, syringe, gloves, a
DISPLAY room description with item and move for current room
Ask the user for directions.
If they choose North and it's a valid move for current room
SET current room TO the room to the North
PRINT You moved north!
ELIF player choose South and if move is valid
SET current room TO the room to South
PRINT You moved south!
ELIF player choose East and if move is valid
SET the current room TO the one at east
PRINT You moved east!
ELIF player choose West and if move is valid
SET the current room TO the one at the west
PRINT You moved west!
ELSE player choose North and if move is valid
SET the current room TO the one at the north
PRINT You moved north!