Suggestion-Box icon indicating copy to clipboard operation
Suggestion-Box copied to clipboard

Coding Challenge - How much can you squeeze out of "Fifteen Lines of Code"

Open pauljames opened this issue 9 years ago • 1 comments

As a teacher I am always trying to give my younger school pupils small code examples to work from. For fun I sometimes give them fifteen lines to "play" with.

So a challenge - how much animated interactive functionality can you get out of fifteen "uncluttered" lines?

For example;

function setup() { 
  createCanvas(600, 600);
} 

function draw() { 
  translate(width/2, height/2);
  for (i = 1; i <= 25; i++) {
    for (j = 1; j <= 10; j++) {
      rect (j*10, 0, i*j, i*j);  
      fill (i*10, j*25, random(mouseX/2), mouseY/2);
      strokeWeight(j);
      rotate (frameCount/(mouseX*10));
    }       
  }
}

pauljames avatar Jul 18 '17 20:07 pauljames

.

Luciferiix avatar Aug 22 '17 20:08 Luciferiix