Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- function find()
- print("Find the number:")
- ans = read()
- ans = tonumber(ans)
- end
- print("Min:")
- min = read()
- print("Max:")
- max = read()
- print("Generating...")
- num = math.random(min,max)
- sleep(2)
- term.clear()
- while true do
- find()
- if ans == num then
- print("You win!")
- break
- elseif ans < num then
- print("+")
- elseif ans > num then
- print("-")
- else
- print("Error: Wrong input... Try again")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement