Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color = {colors.red, colors.red, colors.orange, colors.orange, colors.yellow, colors.yellow, colors.lime, colors.lime, colors.green, colors.green}
- function drawGraph(gVar, x, y)
- termX, termY = term.getSize()
- gVar = tonumber(math.ceil(gVar))
- if x < 1 then
- x = 1
- elseif x > termX - 2 then
- x = termX - 2
- end
- if y < 10 then
- y = 10
- elseif y > termY then
- y = termY
- end
- if gVar > 10 then
- gVar = 10
- end
- for i = 1, gVar do
- y = y - 1
- term.setCursorPos(x, y)
- --term.setBackgroundColor(color[i])
- term.setTextColor(color[i])
- term.write("==")
- end
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement