ecco7777

CC analog clock

Mar 12th, 2016
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. m=peripheral.wrap("back")
  2. xMax,yMax=m.getSize()
  3. while true do
  4. m.clear()
  5. time=os.time()
  6. for i=1,xMax do
  7. xPos=math.cos((360/12*math.fmod(time,12)-90)/360*6.28)*i+xMax/2
  8. yPos=math.sin((360/12*math.fmod(time,12)-90)/360*6.28)*i+yMax/2
  9. m.setCursorPos(xPos,yPos)
  10. m.write("#")
  11. --print(xPos,yPos)
  12. end
  13. m.setCursorPos(1,1) m.write(time)
  14. sleep(1)
  15. end
Add Comment
Please, Sign In to add comment