35章更改(稍微复杂)
from sys import exit
from sys import argv
from sys import argv
script, your_friend_name = argv
you = 1
your_friend = 1
money_list =[]
you = 1
your_friend = 1
money_list =[]
def gold_room():
print "OK,this room is full of gold. How much do you take?"
next = int(raw_input(">"))
print "And how much do you friend take?"
next_feirnd = int(raw_input(">"))
money_list.append(next)
money_list.append(next_feirnd)
print "\nYou take %d, your friend take %d !And there have two door, one left, one right." % (money_list[0], money_list[1])
if next >= next_feirnd:
print "You need to take left,your friend take right\n"
left_room()
else:
print "You need to take right, your friend take left\n"
right_room()
dead("You greadly bastard!")
print "OK,this room is full of gold. How much do you take?"
next = int(raw_input(">"))
print "And how much do you friend take?"
next_feirnd = int(raw_input(">"))
money_list.append(next)
money_list.append(next_feirnd)
print "\nYou take %d, your friend take %d !And there have two door, one left, one right." % (money_list[0], money_list[1])
if next >= next_feirnd:
print "You need to take left,your friend take right\n"
left_room()
else:
print "You need to take right, your friend take left\n"
right_room()
dead("You greadly bastard!")
def bear_room():
print """There is a bear here.
The bear has a bunch of honey.
The fat bear is in front of another door.
How are you going to move the bear?"""
bear_moved = False
while True:
next = raw_input(">")
if next == "take honey":
dead("The bear looks at you then slaps your face off.")
elif next == "taunt bear" and not bear_moved:
print "The bear has moves from the door.You can go through it now."
bear_moved = True
elif next == "taunt bear" and bear_moved:
dead("The bear gets pissde off and chews your leg off.")
elif next == "open door" and bear_moved:
last_room()
else:
print "I got no idea what that means."
def cthulhu_room():
print """Here you see the grast evil Cthulhu.
He,it,whatever stares at you and you go inasne.
Do you flee for youe life or eat your head?
"""
next = raw_input("> ")
if "flee" in next:
last_room()
elif "head" or "eat" in next:
dead("Well that was tasty!")
else:
cthulhu_room()
def dead(why):
print why, "Good job!","\n How about your frind?"
global you
you = 0
print "you =", you
if money_list[2] >= money_list[3]:
right_room()
else:
left_room()
print """There is a bear here.
The bear has a bunch of honey.
The fat bear is in front of another door.
How are you going to move the bear?"""
bear_moved = False
while True:
next = raw_input(">")
if next == "take honey":
dead("The bear looks at you then slaps your face off.")
elif next == "taunt bear" and not bear_moved:
print "The bear has moves from the door.You can go through it now."
bear_moved = True
elif next == "taunt bear" and bear_moved:
dead("The bear gets pissde off and chews your leg off.")
elif next == "open door" and bear_moved:
last_room()
else:
print "I got no idea what that means."
def cthulhu_room():
print """Here you see the grast evil Cthulhu.
He,it,whatever stares at you and you go inasne.
Do you flee for youe life or eat your head?
"""
next = raw_input("> ")
if "flee" in next:
last_room()
elif "head" or "eat" in next:
dead("Well that was tasty!")
else:
cthulhu_room()
def dead(why):
print why, "Good job!","\n How about your frind?"
global you
you = 0
print "you =", you
if money_list[2] >= money_list[3]:
right_room()
else:
left_room()
def dead_out(why):
print why, "Good job!"
exit(0)
print why, "Good job!"
exit(0)
def start():
print """Welcome to my game
Now, tell me a number, it will decide you life
hahaha, your friend will get a half of your number"""
while True:
next = raw_input(">")
if "0"or "5" in next or "1" in next:
much_next = float(next)
money_list.append(much_next)
money_list.append(much_next/2)
print "You take %d, your friend take %f !" % (money_list[0], money_list[1])
break
else:
print "I got no idea what that means."
print "You can go next toom."
gold_room()
def left_room():
cthulhu_room()
def right_room():
bear_room()
def last_room():
print "Meet you again!\nIf you get money add you number more then your friend, you will dead!"
if you == 1:
sum1 = money_list[0] + money_list[2]
sum2 = money_list[1] + money_list[3]
print "You got %f, your friend got %f" % (sum1, sum2)
if sum1 > sum2:
dead_out("Oh,you dead!")
elif sum1 == sum2:
dead_out("It's unbelibale! You are all good!")
else:
dead_out("You friend dead!")
else:
print "I'm sorry you had dead"
exit(0)
start()
print """Welcome to my game
Now, tell me a number, it will decide you life
hahaha, your friend will get a half of your number"""
while True:
next = raw_input(">")
if "0"or "5" in next or "1" in next:
much_next = float(next)
money_list.append(much_next)
money_list.append(much_next/2)
print "You take %d, your friend take %f !" % (money_list[0], money_list[1])
break
else:
print "I got no idea what that means."
print "You can go next toom."
gold_room()
def left_room():
cthulhu_room()
def right_room():
bear_room()
def last_room():
print "Meet you again!\nIf you get money add you number more then your friend, you will dead!"
if you == 1:
sum1 = money_list[0] + money_list[2]
sum2 = money_list[1] + money_list[3]
print "You got %f, your friend got %f" % (sum1, sum2)
if sum1 > sum2:
dead_out("Oh,you dead!")
elif sum1 == sum2:
dead_out("It's unbelibale! You are all good!")
else:
dead_out("You friend dead!")
else:
print "I'm sorry you had dead"
exit(0)
start()