Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- nb = 3
- t = {}
- onrow = true
- while onrow do
- for i=1, nb do
- num = math.random(9)
- t[i] = num
- end
- for i=1, nb do
- sleep(0.4)
- print(t[i])
- sleep(0.4)
- term.clear()
- term.setCursorPos(1, 1)
- end
- for i=1, nb do
- print("Enter the numbers individually in order: ")
- inum = io.read()
- if inum ~= t[i] then
- print("Sorry, the sequence was incorrect!")
- onrow = false
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment