我承认,我偷懒了,少打了大量代码(剧情),英文太差,下次可以编个中文的试试

 #!/urs/bin/python
#coding:utf-8
from sys import exit
from random import randint def death():
quips=["you died. you kinda suck at this.",
"nice job,you died ...jackass.",
"such a luser",
"I have a small puppy that's better at this."] print quips[randint(0,len(quips)-1)]
exit(1) def central_corridor():
print "the gothons of planet percal #25 have invaded your ship and destroyed"
print "your entire crew. you are the last surviving member and your last"
print "mission is to get the neutron destruct bomb from the weapons armory"
print "put it in the bridge,and blow the ship up after getting into an "
print "escape pod"
print "\n"
print "you're running down the central corrdior to the weapons armory when"
print "a gothon jumps out,red scaly skin ,dark grimy teeth,and evil clown costume"
print "flowing around his hate filled body.he's blocking the door to the"
print "armory and about to pull a weapon to blast you." action =raw_input(">>") if action == "shoot!":
print "quick on the draw you yank out your blaster and fire it at the gothon"
print "his clown costume is flowing and moving around his body,which throws"
return "you are dead.then he eats you." elif action == "dodge!":
print "like a world class boxer you dodge,weave ,slip and slide right"
print "as the gothon's blaster cranks a laser past your head."
return "death" elif action == "tell a joke":
print "lucky for you they made you learn gothon insults in the academy."
print "you tell the one tothon joke you know:"
return "laser_weapon_armory"
else :
print "DOES NOT COMPUTE"
return 'central_corridor' def laser_weapon_armory():
print "you do a dive roll into the weapon armory,crouch and scan the room"
print "for more gothens that might be hiding. it's dead quiet,too quiet"
print 'get the bomb. the code is 3 digits.'
code = "%d%d%d" % (randint(1,9),randint(1,9),randint(1,9))
guess = raw_input("[keypad]>>")
guesses = 0 while guess != code and guesses<10:
print "BZZZZZZZ"
guesses+=1
guess = raw_input("[keypad]>>") if guess == code:
print "bridge where you must place it in the right spot"
return 'the_bridge'
else :
print "ship from their ship and you die"
return 'death' def the_bridge():
print "arm and don't want to set it off." action = raw_input(">>") if action == "throw the bomb":
print "it goes off"
return 'death'
elif action == "slowly place the bomb":
print "get off this tin can"
return 'escape_pod'
else:
print "DOES NOT"
return "the_bridge" def escape_pod():
print "do you take?"
good_pod = randint(1,5)
guess = raw_input("[pod #]>>") if int(guess) != good_pod:
print "into jam jelly"
return 'death'
else:
print "time .you won"
exit(0) ROOMS = {
'death':death,
'central_corridor':central_corridor,
'laser_weapon_armory':laser_weapon_armory,
'the_bridge':the_bridge,
'escape_pod':escape_pod
} def runner(map,start):
next = start while True:
room= map[next]
print "\n-----------"
next = room() runner(ROOMS,'central_corridor')

Output:

 -----------
the gothons of planet percal #25 have invaded your ship and destroyed
your entire crew. you are the last surviving member and your last
mission is to get the neutron destruct bomb from the weapons armory
put it in the bridge,and blow the ship up after getting into an
escape pod you're running down the central corrdior to the weapons armory when
a gothon jumps out,red scaly skin ,dark grimy teeth,and evil clown costume
flowing around his hate filled body.he's blocking the door to the
armory and about to pull a weapon to blast you.
>>tell a joke
lucky for you they made you learn gothon insults in the academy.
you tell the one tothon joke you know: -----------
you do a dive roll into the weapon armory,crouch and scan the room
for more gothens that might be hiding. it's dead quiet,too quiet
get the bomb. the code is 3 digits.
[keypad]>>123
BZZZZZZZ
[keypad]>>369
BZZZZZZZ
[keypad]>>789
BZZZZZZZ
[keypad]>>741
BZZZZZZZ
[keypad]>>456
BZZZZZZZ
[keypad]>>951
BZZZZZZZ
[keypad]>>753
BZZZZZZZ
[keypad]>>852
BZZZZZZZ
[keypad]>>147
BZZZZZZZ
[keypad]>>963
BZZZZZZZ
[keypad]>>563
ship from their ship and you die -----------
such a luser ***Repl Closed***

最新文章

  1. PyQt4入门学习笔记(二)
  2. Learning Bayesian Network Classifiers by Maximizing Conditional Likelihood
  3. JQuery 学习笔记(01)
  4. bk. 2014.12.1
  5. 知识总结提炼-AP模块
  6. 如何交换两个等长整形数组使其数组和的差最小(C和java实现)
  7. 实践GTD三周年后的体会
  8. Excel日期格式提取year
  9. shell获取本地ip的三种方法
  10. 设置tomcat启动超时,不会自动停止
  11. MYSQL5.6数据库ZIP安装以及VS中使用注意事项
  12. .Net Core 环境搭建
  13. PyCharm使用Anaconda新建的环境
  14. 代码: jquery 插件开发(自用插件)
  15. thinkphp5---使用自定义助手函数
  16. 【译】第41节---EF6-事务
  17. 微服务 Rpc和Rest协议
  18. Log Structured Merge Trees (LSM)
  19. Note for video Machine Learning and Data Mining——training vs Testing
  20. Linux系统——公网定制化yum仓库部署

热门文章

  1. Ubuntu系统下Bazel编译Tensorflow环境
  2. Docker下载镜像并创建容器运行
  3. tee 多重定向
  4. Linux下配置静态IP地址,设置DNS和主机名
  5. webpack 零基础到工程实战(1)
  6. .NET界面控件DevExpress v19.1.3重磅来袭
  7. 【UOJ#349】[WC2018] 即时战略
  8. 【NOIP2013模拟联考5】军训
  9. 【NOIP2015模拟11.3】备用钥匙
  10. Win10 设置系统时间