Anonymous user
Menu: Difference between revisions
→{{header|Lua}}
Line 322:
=={{header|Lua}}==
<lang lua>function choice(choices)
<lang lua>choices = {"fee fie", "huff and puff", "mirror mirror", "tick tock"}▼
for i, v in ipairs(choices) do print(i, v) end
print"Enter your choice"
local selection = io.read() + 0
if choices[selection] then print(choices[
else choice(choices)
end
end</lang>
=={{header|OCaml}}==
|