Advertisement
9551

Untitled

Dec 22nd, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. term.setGraphicsMode(true)
  2. term.clear()
  3. local w,h = term.getSize(1)
  4. local mathics = function(n)
  5. --return math.log(n/150)*h/10
  6. --return math.atan2(math.sin(n/20),n/150)*200
  7. return %%math(n)%%
  8. end
  9. local count = w
  10. local woffset = 130
  11. local ok,err = pcall(function()
  12. local list = {}
  13. for i=1,count do
  14. table.insert(list,mathics(i))
  15. end
  16. term.setBackgroundColor(colors.white)
  17. local maxval = 0
  18. for k,v in pairs(list) do
  19. maxval = math.max(maxval,v)
  20. end
  21. for k,v in pairs(list) do
  22. if k ~= 1 then
  23. paintutils.drawLine(k-1,maxval-(list[k-1]+(-woffset)),k,maxval-(v+(-woffset)),colors.white)
  24. end
  25. end
  26. end)
  27. term.setBackgroundColor(colors.black)
  28. sleep(3)
  29. term.setGraphicsMode(false)
  30. if not ok then error(err) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement