random number test in Lua - E and J helped
This commit is contained in:
10
lua/randTest.lua
Normal file
10
lua/randTest.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
io.write("Pick a number: ")
|
||||
local number = io.read("*n")
|
||||
local randnum = math.random(1, number)
|
||||
print("The number is ", randnum)
|
||||
-- ask to rerun script
|
||||
print("Run again (y/n)?")
|
||||
local cmd = io.read()
|
||||
if cmd == "y" then
|
||||
dofile("randTest.lua")
|
||||
else end
|
||||
Reference in New Issue
Block a user