Lua 简单的IO交互 和迷宫代码
摘要:
1 function room1 () 2 print("in room1") 3 local move = io.read() 4 if move == "south" then 5 return room3() 6 elseif move == "east" then 7 return room2() 8 else 9 print("invalid move")10 return room1() -- stay in the same room11 end12 end13 14 ... 阅读全文
posted @ 2014-02-27 08:13 Step-BY-Step 阅读(391) 评论(0) 推荐(0) 编辑