Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i=0; i<num; i++) {
- for (int j=0; j<num; j++) {
- float r = random(1); // this will get you a number between 0.0 and 0.9999999etc
- if (r<0.2) { // if the random numbers happens to be between 0.0 and 0.19999 the fill will be some color (with a transparency of 150)
- fill(255,128,0,150);
- } else { // if the random numbers happens to be between 0.2 and 0.99999 the fill will be red (with a transparency of 150)
- fill(255,0,0,150);
- }
- rect(gap * (i+1) + cellsize * i + random(-10,10), gap * (j+1) + cellsize * j + random(-10,10), cellsize, cellsize);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement