Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grid = {}
- width, height = term.getSize()
- gradient = height/width
- heightIntercept = -(gradient*width) + height
- for w=1,width do
- grid[w] = {}
- for h=1,height do
- grid[w][h] = ""
- equation = gradient*w + heightIntercept
- if equation%1 < 0.5 then
- equation = math.floor(equation)
- else
- equation = math.ceil(equation)
- end
- term.setCursorPos(w,h)
- if w == 1 or h == 1 or w == width or h == height then
- term.setBackgroundColor(colors.green)
- term.write(" ")
- elseif h == equation then
- term.setBackgroundColor(colors.green)
- term.write("x")
- else
- term.setBackgroundColor(colors.lime)
- term.write(" ")
- end
- end
- end
- sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement