Advertisement
montur

graph

Jan 5th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. local monitor = peripheral.find("monitor")
  2. term.redirect(monitor)
  3. monitor.setTextScale(0.5)
  4. local termWidth, termHeight = term.getSize()
  5.  
  6. local value = 0
  7. local time = 0
  8. while true do
  9. value = value + 0.1
  10. local sin = math.sin(value)
  11. local sinval = 50 * sin
  12. sinval = 50 + sinval
  13. scaledHeight = termHeight / 100
  14. time = time + 1
  15. if time > termWidth then
  16. time = 0
  17. term.setBackgroundColor(colors.black)
  18. term.clear()
  19. end
  20.  
  21. local x = time
  22. local y = sinval * scaledHeight
  23. paintutils.drawPixel(x, y, colors.white)
  24. sleep(0.1)
  25. end
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement