Jharakn

Untitled

Jan 13th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2. -- round "up" to absolute value, so we treat negative differently
  3. -- that is, round (-1.5) will return -2
  4.  
  5. function round (x)
  6. if x >= 0 then
  7. return math.floor (x + 0.5)
  8. end -- if positive
  9.  
  10. return math.ceil (x - 0.5)
  11. end -- function round
  12.  
  13. local monitor = peripheral.wrap("back")
  14.  
  15.  
  16. local line = {"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"}
  17.  
  18. while true do
  19. line[1] = "Welcome to the Dark Forest Reaserch Facility"
  20. line[2] = ""
  21. line[3] = "The current time is "..round(os.time())
  22. line[4] = ""
  23. line[5] = ""
  24. line[6] = "All unautherised personel to report to Facility Admistrators"
  25. line[7] = ""
  26. line[8] = ""
  27. line[9] = ""
  28. line[10] = ""
  29. line[10] = ""
  30. line[12] = ""
  31.  
  32. for i = 1,12 do
  33. monitor.setCursorPos(1,i)
  34. monitor.clearLine()
  35. monitor.write(line[i])
  36. end
  37.  
  38. sleep(0)
  39. end
Advertisement
Add Comment
Please, Sign In to add comment