Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created May 4, 2012 03:06
Show Gist options
  • Save jonmarkgo/2591643 to your computer and use it in GitHub Desktop.
Save jonmarkgo/2591643 to your computer and use it in GitHub Desktop.
Maze Thing
correct_maze_moves = ["left","right","left"]
correct_moves_made = 0
def exit_maze():
print "YOU WIN"
def enter_maze():
global correct_moves_made
print "what way do you go in the maze?"
next = raw_input ("> ")
if next == correct_maze_moves[correct_moves_made]:
print "you go " + next
correct_moves_made += 1
if correct_moves_made == len(correct_maze_moves):
exit_maze()
else:
enter_maze()
else:
print "You fail, try again"
correct_moves_made = 0
enter_maze()
enter_maze()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment