/* A program to generate a grid of random Truchet tiles using arcs. by Brock Craft http://www.brockcraft.com 12 Mar 2008 */ PImage p; PImage q; int imageX=0; int imageY=0; int sceneSize=401; int numTiles=sceneSize-143; // a kludge to make the tiles fit the scene boolean over=false; Truchet truchet[] = new Truchet[numTiles]; void setup(){ size (sceneSize,sceneSize); //must be divisible by 25! smooth(); noFill(); ellipseMode(CORNER); rectMode(CORNER); p=loadImage("tile1-1.png"); q=loadImage("tile1-2.png"); for (int h=0;h=myX && mouseX<=myX+25 && mouseY>=myY && mouseY<=myY+25){ return true; } else { return false; } } void flip () { orientation=abs(orientation-1); } }