Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setGraphicsMode(true)
- term.clear()
- local w,h = term.getSize(1)
- local mathics = function(n)
- --return math.log(n/150)*h/10
- --return math.atan2(math.sin(n/20),n/150)*200
- return %%math(n)%%
- end
- local count = w
- local woffset = 130
- local ok,err = pcall(function()
- local list = {}
- for i=1,count do
- table.insert(list,mathics(i))
- end
- term.setBackgroundColor(colors.white)
- local maxval = 0
- for k,v in pairs(list) do
- maxval = math.max(maxval,v)
- end
- for k,v in pairs(list) do
- if k ~= 1 then
- paintutils.drawLine(k-1,maxval-(list[k-1]+(-woffset)),k,maxval-(v+(-woffset)),colors.white)
- end
- end
- end)
- term.setBackgroundColor(colors.black)
- sleep(3)
- term.setGraphicsMode(false)
- if not ok then error(err) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement