Python Python Collections (2016, retired 2019) Dungeon Game Movement

Kate Bishop
Kate Bishop
1,410 Points

for this part in the dungeon game im getting an error to do with the input function?

monster, door, player = get_locations()
while True: valid_moves = get_moves(player) clear_screen() print("Welcome to the dungeon!") print("You're currently in room {}".format(player)) #fill with player position print("You can move {}".format(", ".join(valid_moves))) #fill with avalible moves print("Enter QUIT to quit")

move = input("> ")
move = move.upper()

if move == "QUIT":
    break
if move in valid_moves:
    player = move_player(player, move)
else:
    print("\n ** Walls are hard! Dont run into them! **\n")
    continue

Heres what in prints out:

Welcome to the dungeon! You're currently in room (3, 3) You can move LEFT, RIGHT, UP, DOWN Enter QUIT to quit

QUIT Traceback (most recent call last): File "Untitled.py", line 60, in <module> move = input("> ") File "<string>", line 1, in <module> NameError: name 'QUIT' is not defined

1 Answer

Andrey Misikhin
Andrey Misikhin
16,529 Points

I don't see mistakes, but it will be better if you show all your listing with formating.