#!/usr/bin/python
#coding:utf-8
from sys import exit def gold_room():
print "this room is full of gold. how much do you take?" next = raw_input(">>")
if "" in next or "" in next:
how_much = int(next)
else:
dead("man, learn to type a number") if how_much < 50:
print "nice,you're not greedy,you win"
exit(0)
else:
dead("you greedy bastard") def bear_room():
print "there is a bear here"
print "the bear has a bunch of honey"
print "the fat bear is in front of another door."
print "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 moved from the door.you can go through it now"
bear_moved = True
elif next == "taunt bear" and bear_moved:
dead("the bear gets pissed off and chews your legs off")
elif next == "open door" and bear_moved:
gold_room()
else:
print "I got no idea what that means" def cloth_room():
print "here you see the great evil cthulhu"
print "he , it,whatever stares at you and you go insane"
print "do you flee for your life or eat your head?" next = raw_input(">>") if "flee" in next:
start()
elif "head" in next:
dead("well that was tasty")
else:
cloth_room() def dead(why):
print why,"good job"
exit(0) def start():
print "you are in a dark room"
print "there is a door to your left and right"
print "which one do you take?" next = raw_input(">>") if next == "left":
bear_room()
elif next == "right":
cloth_room()
else:
dead("you stumble around the room until you starve") start()

相关函数:

Python List append()方法

最新文章

  1. KVM 基本命令
  2. 割点和桥---Tarjan算法
  3. jq实现点击弹出框代码
  4. python基础语法(二)
  5. pads 扇出
  6. 怎么在Form1调用Form2中的成员?
  7. 【C#学习笔记】读access2007
  8. 转:Java同步synchronized使用
  9. 总结一下.net framework适合装在哪些系统中
  10. SQL Server 修改AlwaysOn共享网络位置
  11. 14.并发与异步 - 3.C#5.0的异步函数 -《果壳中的c#》
  12. 剑指offer用位运算实现两个数相加,及python相关的位操作
  13. bootstrap treeview 树形数据生成
  14. H5 29-div和span标签
  15. vue实例相关
  16. vue基本语法
  17. Java SE之反射技术[Field](二)
  18. android:clipChildren 属性
  19. [SQL Server 2014] 微软将于年底发布新版数据库SQL Server 2014
  20. Oracle数据库中的分页--rownum

热门文章

  1. loading 加载工具
  2. UVA 12849 Mother’s Jam Puzzle( 高斯消元 )
  3. Bloxorz I (poj3322) (BFS)
  4. SSM商城系统开发笔记-问题02- Error creating bean with name &#39;userController&#39;
  5. VS2012在解决方案资源管理器显示解决方案名称
  6. 一、Vs2019扩展多了 导航到反编译的源码中运行
  7. LA 3263 That Nice Euler Circuit(欧拉定理)
  8. 分布式锁的实现【基于ZooKeeper】
  9. git上传文件夹的问题
  10. 文本框的SelectionDirection属性