MrLetsplay2003

Program (LUA/Computercraft):

Mar 31st, 2015
613
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- ----------------------------------------
  2. -- This is a simple Program but it's funny.
  3. -- So have fun to play.
  4. -- ---------------------------------------
  5.  
  6. -- .................
  7. -- With Randomizer
  8. -- By MrLetsplay2003
  9. -- .................
  10.  
  11. v = 3
  12. write("Please guess a Number between 1 and 100")
  13. z = math.random(1,100)
  14. while true do
  15.  an = io.read()
  16.  write("You have "..v.." attempts left")
  17.  v = v-1
  18.  if v < 0 then
  19.  print("You lost. No attempts")
  20.  sleep(1)
  21.  shell.run("reboot")
  22.  end
  23.  if an+0 == z then
  24.   print("You won the game")
  25.   break
  26.  elseif an+0 > z then
  27.   print("Smaller")
  28.  elseif an+0 < z then
  29.   print("Bigger")
  30.  else
  31.   print("This isn't a valid input")
  32.  end
  33. end
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment