Lesson 1.4
Modifying even or odd elements in grid:int gridW = 10; int gridH = 10; int border = 60; int stepX = 50; int stepY = 50; int graphicSize = 25; int offset = 5; void setup() { size(800,800); noStroke(); fill(0); rectMode(CENTER); background(255); float rotation = 0; translate(border, border); for(int i=0;i < gridH;i++) { for(int j = 0;j < gridW;j++) { println("no: "+rotation+" no2: "+(j%2*offset)); // graphicList.add(new Graphic(j * distX, i * distY + j%2*offset, graphicSize)); // useing the modulus operator to aply and offset to odd numbers rect(j * stepX,i * stepY + j%2*offset, graphicSize, graphicSize); } } }