Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- textutils.slowPrint("Guess the Number")
- print("You have 6 guesses. Guess the number before you run out of guesses.")
- numb = math.random(1, 100)
- while true do
- guess = io.read()
- guess = tonumber(guess)
- if guess == numb then
- win = true
- break
- else
- print("Incorrect!")
- if guess > numb then
- print("Your guess was too high.")
- elseif guess < numb then
- print("Your guess was too low.")
- else
- print("I have no idea what happened.")
- end
- tries = tries + 1
- end
- end
Add Comment
Please, Sign In to add comment