// XOR Fractal - Jim Bumgardner int fieldSize = 128; PGraphics fg; void setup() { size(496,496); fg = createGraphics(fieldSize,fieldSize,P2D); fg.loadPixels(); frameRate(12); smooth(); } void draw() { int n = 0; for (int y = 0; y < fieldSize; ++y) { for (int x = 0; x < fieldSize; ++x) { int v = ((y ^ (x+frameCount/4)) % 3); fg.pixels[n] = (v & 1) > 0? #FFFFFF : #000000; n++; } } fg.updatePixels(); image(fg,0,0,496,496); }