Created
May 4, 2012 03:06
-
-
Save jonmarkgo/2591643 to your computer and use it in GitHub Desktop.
Maze Thing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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