1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
print("Hello, world! (printed)") return function(n) local a = math.random(n) while true do io.stdout:write("Guess? ") local x = tonumber(io.stdin:read()) if x < a then print("Too small!") elseif x > a then print("Too big!") else print("Bingo!") break end end end