MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / prompt

Function prompt

TEXTVENTURE/game.py:415–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

413
414# Prompt for Player Input
415def prompt():
416 acceptable_actions = ['move', 'travel', 'go', 'walk', 'inspect', 'examine', 'look', 'interact', 'quit']
417
418 print("\n======================================")
419 print("What would you like to do? ❔")
420 action = input("> ")
421
422 while action.lower() not in acceptable_actions:
423 print("\nI don't understand that command.\nPlease enter a valid command. ⚠️\n")
424 action = input("> ")
425
426 if action.lower() == "quit":
427 quit_game()
428
429 elif action.lower() in ['move', 'travel', 'go', 'walk']:
430 player_move(action.lower())
431
432 elif action.lower() in ['inspect', 'examine', 'look', 'interact']:
433 player_interact(action.lower())
434
435# ---- Solved ---- #
436"""

Callers 1

main_game_loopFunction · 0.85

Calls 3

quit_gameFunction · 0.85
player_moveFunction · 0.85
player_interactFunction · 0.85

Tested by

no test coverage detected