35章更改(稍微复杂)

from sys import exit
from sys import argv
script, your_friend_name = argv
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!")
  
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()
def dead_out(why):
 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()


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值