Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ----------------------------------------
- -- This is a simple Program but it's funny.
- -- So have fun to play.
- -- ---------------------------------------
- -- .................
- -- With Randomizer
- -- By MrLetsplay2003
- -- .................
- v = 3
- write("Please guess a Number between 1 and 100")
- z = math.random(1,100)
- while true do
- an = io.read()
- write("You have "..v.." attempts left")
- v = v-1
- if v < 0 then
- print("You lost. No attempts")
- sleep(1)
- shell.run("reboot")
- end
- if an+0 == z then
- print("You won the game")
- break
- elseif an+0 > z then
- print("Smaller")
- elseif an+0 < z then
- print("Bigger")
- else
- print("This isn't a valid input")
- end
- end
Advertisement