Advertisement
TangentDelta

TangentClock ver. 2

Dec 27th, 2011
7,510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. --Title: TangentClock
  2. --Version: Ver. 2
  3. --Last Revised: 12/27/2011
  4. --Last Revised By: TangentDelta (alias Hydrogen)
  5. --Author: TangentDelta (alias Hydrogen)
  6. --Platform: ComputerCraft LUA Virtual Machine
  7. --Notes: Now displays correctly
  8.  
  9. minutes = 0
  10. hours = 0
  11. function clock()
  12.  for seconds = 0, 60, 1 do
  13.   shell.run("clear")
  14.   print (hours, ":",minutes,">", seconds)
  15.   print ("hours:minutes>seconds")
  16.    if seconds == (60) then
  17.     minutes = minutes + 1    
  18.     clock()
  19.    end
  20.    if minutes == (60) then
  21.     hours = hours + 1
  22.     minutes = 0
  23.    end
  24.    sleep (1) --you might want to edit this so that the seconds are more precise
  25.   end
  26.  seconds = 0
  27. end
  28. clock()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement