← Back to all posts
4
A basic choose your own adventure! (CYOA)

import random

print("Hello man, wassuppp")
name = input("was your name? ")
print("hi", name, "welcome to North Korea, survivor edition!")
print("you have 2 paths you can take")
pathselect1 = input("write 1 for path 1 write 2 for path 2 ")
if pathselect1 == "2":

# next 3 lines need to be indented 1 tab - I fixed it
print("oh no I see Kim Jung-Un")
print("I think he sees you…")
print("you were executed, game over")

elif pathselect1 == "1":

# next 3 lines need to be indented 1 tab - I fixed it
print("you are at a cool hotel")
print("the lady at the hotel says, “안녕하세요, 무엇을 도와 드릴까요?”")
# next line should also be indented -- they only get pathselect2 IF they chose 1 in previous decision
pathselect2 = input("she asked you how may I help you? You can ask for a room or go.Press 1 to get a room, press 2 to go ")

I fixed things on the rest of this: INDENTATION, "" marks - can't copy and paste from Word

" " will work, “ ” will not work

if pathselect2 == "1":
    print("she takes you to your room, which Kim Jung-Un ends up being in")
    print("you were executed, game over")
elif pathselect2 == "2":
    print("you made it to the airport!")
    print("you are hungry, you can get candy from a stand at the airport or get inflight snacks, but your flight home isn’t for another few hours, so you could die of hunger.")
    pathselect3 = input("press 1 to get food from the stand at the airport, press 2 to wait for your flight. ")
    if pathselect3 == "1":
        print("the merchant ended up being Kim Jung-Un")
        print("you were executed, game over")
    elif pathselect3 == "2":
        print("you died of hunger, game over.")

(I know that is dark, but it is a funny one!)