Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- barGraph = peripheral.wrap("top")
- x,y = barGraph.getSize()
- function drawGraph(percentValue)
- for j = y,1,-1 do
- barGraph.setCursorPos(1,j)
- if ( y-j ) * ( y/100 ) <= percentValue then
- barGraph.setBackgroundColour(colors.green)
- else
- barGraph.setBackgroundColour(colors.black)
- end
- barGraph.write(string.rep(" ",x))
- end
- end
- for i = 1,100 do
- drawGraph(i)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment