标签:pre cal ast elseif sharp csharp print move highlight
function room1()
local move = io.read()
if move == "south" then
print("enter room3")
return room3()
elseif move == "east" then
print("enter room2")
return room2()
else
print("invalid move")
return room1()
end
end
function room2()
local move = io.read()
if move == "south" then
print("enter room4")
return room4()
elseif move == "west" then
print("enter room1")
return room1()
else
print("invalid move")
return room2()
end
end
function room3()
local move = io.read()
if move == "north" then
print("enter room1")
return room1()
elseif move == "east" then
print("enter room4")
return room4()
else
print("invalid move")
return room3()
end
end
function room4()
print("congratilations")
end
room1()
标签:pre cal ast elseif sharp csharp print move highlight
原文地址:http://www.cnblogs.com/mercurys/p/7985952.html