Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. int space = (10), step = 10;
  2. int i;
  3. boolean b;
  4.  
  5. void setup() {
  6. size(500, 500 );
  7. background(0);
  8. stroke(255);
  9. }
  10.  
  11. void draw() {
  12. stroke ( random(256), random(256),random(256));
  13.  
  14. if ( i+space < width/2)
  15. {
  16. b = true;
  17. } else
  18. {
  19. b = false;
  20. }
  21.  
  22. // kortere versie b = i+space, space, i+space, height-space);
  23.  
  24. if ( b) //b == true
  25. {
  26. //vertical lines
  27. line(i+space, space, i+space, height-space);
  28. } else
  29. {
  30. //horizontal line
  31. line( width/2, i-width/2 + space*2, width-space, i - width/2 + space*2);
  32. }
  33.  
  34. i+=step;
  35.  
  36. if ( i + space > height + width/2 - 2*space)
  37. {
  38. i = 0;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement