def main(): instructions() def instructions(): print("This is a program to simulate an average, everyday morning. You are a normal teenager waking up and getting ready for school.") print("Your overall goal in this simulation? Make it to the bus stop on time.") print("If you miss the bus it’s game over. To progress in this game, enter the number provided for your choice.") print("You can quit at any time, but your progress will not be saved. Would you like to begin?") print("1) Begin") print("2) I don't really feel like it...") choice = int(input("Your choice: ")) if choice == 1: print("") alarmClock() elif choice == 2: print("") beginNow() def beginNow(): print("Welp… as the narrator I am overpowering this choice. You’re starting.") print("") alarmClock() def alarmClock(): print("You open your eyes, the sound of your alarm clock filling the room. It’s Friday morning. The weekend is but a day away. Still… the day that stands between the weekend and you is filled with school. Do you get up?") print("1) Don’t really have much of a choice, do I?") print("2) Five more minutes…") print("3) Quit") choice = int(input("Enter your choice: ")) if choice == 1: print("") youDressed() elif choice == 2: print("") overSlept() elif choice == 3: print("") quitGame() def overSlept(): print("You turn off your alarm clock and close your eyes, thinking five more minutes won’t hurt anything.") print("Unfortunately when you open your eyes, your alarm clock reads 8:30. Looks like you not only missed the bus but you’re also late for first period. Sucks for you.") print("") playAgain() def youDressed(): print("Doing your best to ignore your longing for more sleep, you get out of bed. You turn off your alarm clock and rub the sleep out of your eyes before looking down. Are you wearing day clothes?") print("1) I fell asleep before I could change") print("2) I’m wearing my awesome glow in the dark dinosaur pajamas!") print("3) Quit") choice = int(input("Enter your choice: ")) if choice == 1: print("") sleptClothes() elif choice == 2: print("") inPajamas() elif choice == 3: print("") quitGame() def sleptClothes(): print("You notice that you fell asleep in your clothes from yesterday. You could wear them again today if you really wanted to. But you decide against it and grab some new clothes for the day ahead of you. ") print("You make your way to the bathroom grabbing a towel and every other such thing you need for your morning preparations. You close the door to the bathroom behind you. Do you lock it?") print("1) Of course.") print("2) It didn’t really cross my mind.") print("3) Quit") choice = input("Enter your choice: ") if choice == 1: print("") lockedShower() elif choice == 2: print("") unlockedShower() elif choice == 3: print("") quitGame() def inPajamas(): print("Though awesome, your dinosaur be speckled pajamas are not really appropriate attire for school. You may or may not care about this fact, but dress codes are dress codes. And you pajamas do not fit the dress code.") print("You grab some new clothes for the day ahead of you. You make your way to the bathroom grabbing a towel and every other such thing you need for your morning preparations.") print("You close the door to the bathroom behind you. Do you lock it?") print("1) Of course.") print("2) It didn’t really cross my mind.") print("3) Quit") choice = input("Enter your choice: ") if choice == 1: print("") lockedShower() elif choice == 2: print("") unlockedShower() elif choice == 3: print("") quitGame() def lockedShower(): print("You take your shower and then proceed to get dressed. Looking in the mirror you grab your toothbrush and proceed to take care of your needs in the bathroom.") print("After all, cleanliness is next to godliness. So good hygiene is obviously the first step you shall take to ensure world domination.") print("After completing the necessary steps for world domination you unlock the door and head downstairs. You do notice that the hallway and stairwell are a bit dark though.") print("Dark enough that you can make out the faint outline of the stairs at least. Do you turn on the lights?") print("1) Yea, I don’t wanna walk down the stairs in the dark.") print("2) Nah, I don’t need light. It’s just the stairs.") print("3) Quit") choice = input("Enter your choice: ") if choice == 1: print("") lightsOn() elif choice == 2: print("") lightsOff() elif choice == 3: print("") quitGame() def unlockedShower(): print("You step into the shower and turn the water. As you wash yourself a tiny giggle sounds from behind the shower curtain. You realize a little too late that it’s the giggle one of your younger siblings.") print("It’s too late to react though, the sound of the toilet flushing reaches you your ears as the water suddenly becomes scalding hot.") print("You jump back, slipping on the wall and hit your head on the wall. Don’t think you’ll be going to school today. A trip to the doctor to check for a concussion might be in order though. Sucky start to a day.") print("") playAgain() def lightsOn(): print("You casually flip the light switch on the way through the hall. As soon as light fills the room you notice that there are toys, both belonging to the dog and your younger siblings, strewn all about the stairs. ") print("It’s a literal battlefield. It’s a good thing you turned on the lights. Things could’ve turned south really fast if you hadn’t.") print("You quickly make it down, avoiding all of the along on the way. Walking past the kitchen you see the clock. You have ten minutes until the bus will arrive. That’s about how long it’ll take to get there. ") print("But you’re also incredibly hungry at the moment. Do you want to get some breakfast?") print("1) Yea, I’ll grab an apple on my way out.") print("2) No time, gotta get to the bus.") print("3) Quit") choice = int(input("Enter your choice: ")) if choice == 1: print("") pefectWin() elif choice == 2: print("") hungryWin() elif choice == 3: print("") quitGame() def lightsOff(): print("You quickly start making your way down the stairs. You don’t see a need for a bit more light. Perhaps that’s because of the already existent lack of light.") print("But either way, you make it about two steps down before suddenly tripping over an array of different toys. ") print("Tumbling down the stairs is not all that comfortable an experience. Landing on your ankle? Not any better. As you try to stand up a howl of pain escapes you.") print("Your ankle could be anything from sprained to severely fracture. No school for you. The doctor’s office though? Yea, that’s a guarantee.") print("") playAgain() def perfectWin(): print("You quickly grab an apple on your way out. Breakfast is the most important meal of the day, so no point in skipping it.") print("Making your way to the bus stop at a quick pace, you find yourself there just in time to catch the bus before it leaves. Good deal! You’re on time and have breakfast! Sounds like a win to me!") print("") playAgain() def hungryWin(): print("You brush off your hunger and make your way to the bus stop. You make it just in time to catch the bus before it leaves. But at what cost? A hungry belly until lunch? Oh well, at least your on time. Congrats.") print("") playAgain() def quitGame(): print("Don’t feel like making it to the bus? Maybe some other time then!") print("") playAgain() def playAgain(): print("Would you like to play again? 1 for yes. 2 for no. ") choice = int(input("Enter choice: ")) if choice == 1: print("") instructions() elif choice == 2: print("") print("Alright, hope you enjoyed!") main()
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