Jump to content

Menu: Difference between revisions

120 bytes added ,  14 years ago
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[io.read()+0selection])</lang>
else choice(choices)
end
end</lang>
 
<lang lua>choices = choice{"fee fie", "huff and puff", "mirror mirror", "tick tock"}
 
=={{header|OCaml}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.