Guest User

Untitled

a guest
Jan 23rd, 2022
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. void setup(){
  2.   size(500,500);
  3.  
  4.   //randomise lines based on width of window.
  5.   float l1 = random(width);
  6.   float l2 = random(width-l1)+l1;
  7.   float l3 = random(width-l2)+l2;
  8.  
  9.   //vertical lines
  10.   stroke(0,0,255);
  11.   line(l1,height,l1,0);
  12.   stroke(0,255,0);
  13.   line(l2,height,l2,0);
  14.   stroke(255,0,0);
  15.   line(l3,height,l3,0);
  16.  
  17.   //horizontal lines
  18.   float l1h1 = random(height);
  19.   float l1h2 = random(height);
  20.   float l1h3 = random(height);
  21.  
  22.   stroke(0,0,255);
  23.   line(0,l1h1,l1,l1h1);
  24.   stroke(0,255,0);
  25.   line(0,l1h2,l1,l1h2);
  26.   stroke(255,0,0);
  27.   line(0,l1h3,l1,l1h3);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment