"""Dog Simnulator is a text based game that puts the player in the point of view of a dog that has to go on the best possible walk. The player must use trial and error, with knowlage from their previous run of the game to figure out the correct path.""" #thefinalchoice is a function that determines if the def thefinalchoice(): finalchoice = raw_input("Do you go left or right?") if finalchoice == "Right" or finalchoice == "right": print "You go right." print "You walk down the road and come to your house." print "Great job! You went on a walk." exit(0) elif finalchoice == "left" or finalchoice == "Left": print "You turn left." print "You come to a road." print "You then end up at your own house." print "Great job! You went on a walk." exit(0) else: print "Sorry, thats not an option. Try again." thefinalchoice() #paththing is a function that determines if the player goes right or straight def paththing(): path = raw_input("Do you go right or straight?") if path == "Right" or path == "right": print "You go to the right." print "You then end up at a road." print "You head home from there." print "Great job! You went on a great walk." exit(0) elif path == "straight" or path == "Straight": print "You go straight." print "You come to a main road." print "You can go left, and head home, or right and head home." print "Lots of choices, right." thefinalchoice() #twopaths is a function that determines if the player goes left or right def twopaths(): twopaths = raw_input("Do you go left or right?") if twopaths == "Left" or twopaths == "left": print "You go down the greenway." print "You end up at a road." print "You walk down the road and come two your house." print "Great job! You went on a walk." exit(0) elif twopaths == "Right" or twopaths == "right": print "You go down the path. You come to a choice of a path to your right, and one straight ahead." paththing() #hills is a function that determines if the player goes left or right def hills(): hills = raw_input("Do you go left or right.") if hills == "left" or hills == "Left": print "You go down the hill to your left." print "You can go down a path to yor left, or to your right." twopaths() elif hills == "right" or hills == "Right": print "You go down the hill to your right." print "You can go to your left, down a greenway, or straight, up a hill." greenway() else: print "Sorry, thats not an option. Try again." hills() #mainchoice is a function that determines if the player goes left or right def mainchoice(): home = raw_input("Do you go left or right?") if home == "Left" or home == "left": print "You turn left and head home." print "Congrats! You went on a great walk!" exit(0) elif home == "right" or home == "Right": print "You turn right and head home." print "Congrats! You went on a great walk!" exit(0) #left choice determines if the player goes straight or right. def leftchoice(): choice = raw_input("Do you go straight or right?") if choice == "Straight" or choice == "straight": print "You go straight down the path and come to a main road." print "You can go left and go home, or you can go right and go home." print "This game has a variety of choices, right!" mainchoice() elif choice == "Right" or choice == "right": print "You go right and go down the path." print "You then head down the path to home, and arrive back home." else: print "Sorry, thats not an option. Try again." leftchoice() #hillorhill is a function that determines if the player goes left or straight on the greenway def hillorhill(): leftpaththing = raw_input("Do you go right or straight?") if leftpaththing == "Right" or leftpaththing == "right": print "You go up the hill and head home." print "Great job! You went on a great walk!" elif leftpaththing == "Straight" or leftpaththing == "straight": print "You go straight, and come to a path leading to the right, and one straight ahead." leftchoice() else: print "Sorry, thats not an option. Try again." hillorhill() #walkstartleft determines if the player goes straight or left. def walkstartleft(): leftpath = raw_input("Do you go right or straight") if leftpath == "right" or leftpath == "Right": print "You walk down the sidewalk until you come to a hill on the right and another hill on the left." hills() elif leftpath == "Straight" or leftpath == "straight": print "You go straight until you are stopped by construction." print "So you end up going right." print "You walk down the road until you are stopped by even more road work." print "You turn right on to a path and end up at a road." print "You can go right, up a hill, or straight, down a path." hillorhill() else: print "Sorry, thats not an option. Try again." walkstartleft() #anotherchoice determines if the character goes left or straight. def anotherchoice(): choice = raw_input("Do you go left or straight?") if choice == "left" or choice == "Left": print "You walk down the path and arrive at your house." print "Nice job! You wend on a great walk!" exit(0) elif choice == "straight" or choice == "Straight": print "You go up the hill, left and head home." print "Great job! You went on an awesome walk." else: print "Sorry, thats not an option. Try again." anotherchoice() #prkwychoice is a function that determines which way the player goes on the main road def prkwychoice(): prkwychoice = raw_input("Do you go left or right?") if prkwychoice == "left" or prkwychoice == "Left": print "You turn left and head home." print "Fabulous job! You managed tto go on a decent walk." exit(0) elif prkwychoice == "Right" or prkwychoice == "right": print "You walk down the main road and come to a hill." print "You walk down and find that you can go straight up a hill, or left to a path" anotherchoice() else: print "Sorry, thats not an option. Try again." prkwychoice() #hillorpath is a function that determines if the player goes up the hill or down the path def hillorpath(): hillorpath = raw_input("Do you go straight or left?") if hillorpath == "left" or hillorpath == "Left": print "You go up the hill." print "You head back to your house" print "Awesome Job! You managed to go on a walk!" elif hillorpath == "straight" or hillorpath == "Straight": print "You walk onto a path in the woods." print "You end up in front of a street horizontal to you." print "The right is under construction, so you turn left." print "You end up on your street. You arrived home." print "Fantastic job! You went on a great walk!" exit(0) else: print "Sorry, thats not an option. Try again." hillorpath() #grnwychoice is a function that determines which direction the player goes on the greenway def grnwychoice(): grnwypath = raw_input("Do you go left or right?") if grnwypath == "left" or grnwypath == "Left": print "You turn left and walk until you come upon a road." print "The right side of the road is under construction." print "You can go straight or left." hillorpath() elif grnwypath == "Right" or grnwypath == "right": print "You turn right." print "You walk until you come upon a main road." print "You can turn left and go home, or right to a hill." prkwychoice() else: print "Sorry, thats no an option. Try again." grnwypath() #bikechoice is a function that determines if the player goes left or straight. def bikechoice(): bikechoice = raw_input("Do you go left or straight?") if bikechoice == "left" or bikechoice == "Left": print "You turn left." print "You go down the path until you come to a road." print "You head home from there." print "Awesome job! You went on a walk!" exit(0) elif bikechoice == "Straight" or bikechoice == "straight": print "You head straight." print "You end up at a road." print "To the right, there is construction." print "You can go left, up a hill, or straight, down a path." hillorpath() else: print "Sorry, thats not an option. Try again." bikechoice() #caryprkwy is a function that determines if the player goes to the biker trail def caryprkwy(): road = raw_input("Do you go down the biker trail?") if road == "yes" or road == "Yes": print "You go down the biker trail." print "You come to a choice." print "There is a path to the left. There is also a path going straight." bikechoice() elif road == "no" or road == "No": print "You head back home." print "Great Job! you successfully went on a walk!" exit(0) else: print "Sorry, thats not an option. Try again." caryprkwy() #greenway isa function that determines if the player goes down the greenway or not def greenway(): greenway = raw_input("Do you go down the greenway?") if greenway == "yes" or greenway == "Yes": print "You go down the greenway." print "There are two paths. One left, and one right." grnwychoice() elif greenway == "no" or greenway == "No": print "You go up the hill." print "There is a main road at the top of the hill." print "You can head back home, or go to the biker trail." caryprkwy() #walkstart determines if the player goes left or right def walkstart(): print "You exit your house" print "There is a sidewalk horizontal from where you are" pathstart = raw_input("Do you go left or right?") if pathstart == "left" or pathstart == "Left": print "You turn left." print "There is a road to your right." print "The road you are on continues straight ahead." walkstartleft() elif pathstart == "right" or pathstart == "Right": print "You turn right." print "You walk down the sidewalk and eventually come to a greenway." print "There is a hill to your right." greenway() else: print "Sorry, thats not an option. Try again." walkstart() #remote is a function that determines if the player interacts with the remote def remote(): print "You notice that there is the TV remote on the ground." remote = raw_input("Do you push a random button?") if remote == "yes" or remote == "Yes": print "You push a random button with your nose." print "A workout program comes on the TV" print "Your owner speaks again" print "'Hmmm, well maybe I should go outside and do something" print "'Want to go on a walk poof poof?'" print "You wag your tail." walkstart() elif remote == "no" or remote == "No": print "You plop down beside the remote and stare at the TV" print "The TV seems to hypnotize you." print "You now hate walks." print " " print " " print " " print "Good Job." print " " print "Game Over" print "You failed to go on a walk :(" print "(づ◔ ͜ʖ◔)づ" exit(0) else: print "Sorry, thats not an option. Try again." remote() #run is a function that determines if the player runs or not def run(): print "The yard has lots of pine trees everywhere." print "Up in the distance, you see a camel flying with a pickle in its mouth" run = raw_input("Do you wish to run around in the yard?") if run == "yes" or run == "Yes": print "You run some laps around the yard." print "You figure its good enough to be considered a walk." print "You do a mediocre dance" print "Congatulations! You walked yourself...for five minutes" print "Good enough." print "(づ◔ ͜ʖ◔)づ" elif run == "no" or run == "No": print "You flop in a sunny part of the yard. You fall asleep" print "When you wake up, the day is already over" print " " print " " print " " print "Good Job." print " " print "Game Over" print "You failed to go on a walk :(" print "(づ◔ ͜ʖ◔)づ" exit(0) else: print "Sorry, thats not an option. Try again." run() #door is a function that determines if the player whines at the door or not def door(): print "You turn. You see your back door." door = raw_input("Do you whine at the back door?") if door == "yes" or door == "Yes": print "You whine at the back door." print "Your owner waddles over and opens the door for you" print "You trot out into the yard" run() elif door == "no" or door == "No": print "You litterally stay at the door the entire day." print " " print " " print " " print "Good Job." print " " print "Game Over" print "You failed to go on a walk :(" print "(づ◔ ͜ʖ◔)づ" exit(0) else: print "Sorry, thats not an option. Try again." door() #movement is a fuction that determines if the player communicates or not def movement(): print "Your owner speaks in a weird language, but you understand anyway" print "'What is it poof poof?'" movement = raw_input("Do you try to communicate?") if movement == "yes" or movement == "Yes": print "You try to grab your leash on top of your kennel in hopes of showing that you want a walk." print "Sadly, your doggy legs are too short to grab your leash. You are just pawing the side of your kennel." remote() elif movement == "no" or movement == "No": print "Your owner looks puzzled. He speaks again" print "'Alright then'" exit(0) else: print "Sorry, thats not an option. Try again." movement() #startgame is a function that starts the game when called. def startgame(): print "You are a dog." print "A dog deparate for one thing." print "A walk." print "You have one day to go on the best walk your doggy brain can conceive." print "You wake up in your kennel, and you wander over to you bowl, and eat breakfast." print "Your lazy owner is on the couch watching TV." action = raw_input("Would you like to approach?") if action == "yes" or action == "Yes": print "You approach, your owner looks at you." movement() elif action == "no" or action == "No": print "You stay at your bowl." door() else: print "Sorry, thats not an option" startgame() def menu(): print "Welcome to Dog Simulator" print "" print "(づ◔ ͜ʖ◔)づ" print "" print "Use 'yes', 'no', 'right', 'left', and 'straight' to navigate the world." print"" start = raw_input("Type 'start' to begin.") if start == "start" or start == "Start": startgame() else: print "Sorry, thats not an option, try again." print "( ͡° ͜ʖ ͡°)" print "" menu() menu()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question