Damaged

temp

Aug 7th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. barGraph = peripheral.wrap("top")
  2. x,y = barGraph.getSize()
  3.  
  4. function drawGraph(percentValue)
  5. for j = y,1,-1 do
  6. barGraph.setCursorPos(1,j)
  7. if ( y-j ) * ( y/100 ) <= percentValue then
  8. barGraph.setBackgroundColour(colors.green)
  9. else
  10. barGraph.setBackgroundColour(colors.black)
  11. end
  12. barGraph.write(string.rep(" ",x))
  13. end
  14. end
  15.  
  16. for i = 1,100 do
  17. drawGraph(i)
  18. sleep(2)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment