Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
6A-python-story/Main.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
93 lines (80 sloc)
2.72 KB
This file contains 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
import graphics #graphics.display("some writing",["choice1", "choice2"]) outputs a number that is the location in the array for the choice picked | |
def Beginning(): | |
writing = "Person in bed" #main writing section | |
choices = ["wakes up"] #the choices that the user will make (can just be one) | |
choice = graphics.display(writing, choices) #displays everything and allows the user to input the choice to pick | |
if choice == 0: #what the choice the user picked will do | |
wakesUp() | |
def wakesUp(): | |
writing = "gets breakfast made by a machine" | |
choices = ["eats breakfast"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
eatsBreakfast() | |
def eatsBreakfast(): | |
writing = "eats breakfast" | |
choices = ["goes to his job in his self driving car"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
atJob() | |
def atJob(): | |
writing = "Arrives and realises hes been layed off in favor of an AI" | |
choices = ["leaves peacefully", "argue"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
noJobForev() | |
elif choice == 1: | |
noJob() | |
def noJobForev(): | |
writing = "Forever jobless" | |
graphics.display(writing,[]) | |
input() | |
def noJob(): | |
writing = "without a job what does he do" | |
choices = ["punches the boss", "resorts to theft"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
punchBoss() | |
elif choice == 1: | |
theft() | |
def punchBoss(): | |
writing = "boss angry and calls police" | |
choices = ["resist arrest", "leaves peacefully"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
toPrison() | |
elif choice == 1: | |
noJobForev() | |
def theft(): | |
writing = "steals a computer from the reception\npolice called" | |
choices = ["resist arrest", "peacefully complies"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
toPrison() | |
elif choice == 1: | |
toPrison() | |
def toPrison(): | |
writing = "Person in prison" | |
choices = ["appeals to be set free for unlawful layoff", "do nothing"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
setFree() | |
elif choice == 1: | |
deadPrison() | |
def deadPrison(): | |
writing = "dies in prison" | |
graphics.display(writing,[]) | |
input() | |
def setFree(): | |
writing = "wins the case, gets set free and compensated" | |
choices = ["goes back home"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
backHome() | |
def backHome(): | |
writing = "gets email saying hes been hired at the same company with a different position where there is no AI" | |
choices = ["go to bed"] | |
choice = graphics.display(writing,choices) | |
if choice == 0: | |
Beginning() | |
Beginning() |