Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- numb = math.random (1, 100)
- tries = 1
- triesmax = 4
- version = 1.2
- win = false
- end
- do
- term.clear()
- textutils.slowPrint ("---------------------------------")
- textutils.slowPrint ("Guess the Number (Hard) V " .. version )
- textutils.slowPrint ("---------------------------------")
- textutils.slowPrint ("Press enter to continue...")
- io.read()
- textutils.slowPrint ("You have 6 guesses. Guess the number before you run out of guesses.")
- end
- while true do
- if tries > triesmax then
- break
- else
- textutils.slowPrint ("The number is from [1 - 100, whole number]")
- guess = io.read()
- guess = tonumber (guess)
- if guess == numb then
- win = true
- break
- else
- textutils.slowPrint ("Incorrect")
- end
- end
- end
- do
- term.clear()
- textutils.slowPrint ("GAME OVER")
- if win == true then
- textutils.slowPrint ("YOU WON!")
- else
- textutils.slowPrint ("NO ONE WON!")
- end
- textutils.slowPrint ("Thank you for playing, made by usef155")
- end
- textutils.slowPrint ("The number was " .. numb )
- if tries == 1
- textutils.slowPrint ("Player 3 Won")
- if tries == 0
- textutils.slowPrint ("Player 4 Won")
- if tries == 3
- textutils.slowPrint ("Player 1 Won")
- if tries == 2
- textutils.slowPrint ("Player 2 Won")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment