diff options
Diffstat (limited to 'src/syslua')
-rw-r--r-- | src/syslua/test.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/syslua/test.lua b/src/syslua/test.lua new file mode 100644 index 0000000..67b2852 --- /dev/null +++ b/src/syslua/test.lua @@ -0,0 +1,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 + |