aboutsummaryrefslogtreecommitdiff
path: root/src/syslua/test.lua
blob: 67b285238e588b4c8b8921f011e014759e69c165 (plain) (blame)
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