Mini Adventure (For Python 3.1)

By Back2Life on Dec 28, 2010

So, this was basically a test I did for some new functions in Python 3.1. It has really NO purpose, and is just something I worked on when I was bored.

Have fun.

print ("(Currently running Adventure Script 0.1)")
print("Welcome")
x = input ("Who are you? ")
print("Hello there", x)
print("This is your journey, your story", x)
n = input ("Choose a path... left... or right!? Type in Left or Right. ")
if n == ("Left"):
    print ("WRONG, you are dead. You cannot move until someone revives you. Which is never.")
    print ("(Please exit now)")

elif n == ("Right"):
    print ("CORRRRECT!")
    print ("Your adventure is very short, and it is almost over. Yes, I know, lame.")
    y = input ("Choose a direction up down down. Type Up or Down. ")
    if y == ("Up"):
        print ("Correct! You adventure has now ended. Bye.", x ,"has made great history.")
    elif y == ("Down"):
        print ("You lost your adventure! Shoot! You were so close man, you... UGH")

Comments

Sign in to comment.
uberpython   -  Jan 11, 2011

thats so weird lol, its like they just combined two different functions lol. either way i'm glad for this posting, learning if elif functions atm in class and modules. :D

 Respond  
uberpython   -  Jan 11, 2011

this is what i got:

print ("(Currently running Adventure Script 0.1)")
print("Welcome")
x = raw_input ("Who are you? ")
Left = raw_input
Right = raw_input
Up = raw_input
Down = raw_input
print("Hello there", x)
print("This is your journey, your story", x)
n = raw_input ("Choose a path... left... or right!? Type in Left or Right. ")
if n == ("Left"):
    print ("WRONG, you are dead. You cannot move until someone revives you. Which is never.")
    print ("(Please exit now)")

elif n == ("Right"):
    print ("CORRRRECT!")
    print ("Your adventure is very short, and it is almost over. Yes, I know, lame.")
    y = raw_input ("Choose a direction up down down. Type Up or Down. ")
    if y == ("Up"):
        print ("Correct! You adventure has now ended. Bye.", x ,"has made great history.")
    elif y == ("Down"):
        print ("You lost your adventure! Shoot! You were so close man, you... UGH")
 Respond  
Back2Life   -  Jan 11, 2011

uberpython: It worked fine for me, you need to get 3.1. In 3.1 surprisingly there is no raw_input, only an input. :>

 Respond  
uberpython   -  Jan 11, 2011

not sure cause i dont use 3.1, but in order for this snippet to execute correctly, x needs to be declared as a raw_input because names are strings, input is good for intergers but my name isnt 1337 :D also Left and Right Up and Down are not declared so there is errors, too. to make your if elif statements work, it has to be in raw_input

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.