diff --git a/squareGen/squareGen.pde b/squareGen/squareGen.pde new file mode 100644 index 0000000..4dbb59a --- /dev/null +++ b/squareGen/squareGen.pde @@ -0,0 +1,26 @@ +int size = 250; +int weight = 20; +int gridSize = 20; +int repetitions = int(random(5)); +int dir = int(random(0, 2)); + +void setup() { + size(500, 500); +} + +void draw() { + background(255); + stroke(0); + fill(255); + strokeWeight(weight); + float centerW = (width/2)-(size/2); + float centerH = (height/2)-(size/2); + rect(centerW, centerH, size, size); + strokeCap(SQUARE); + stroke(0); + strokeWeight(weight/2); + //fill(255); + float startX = centerW + weight; + float startY = centerH + weight; + line(startX, startY, startX + (gridSize*repetitions*(1-dir)), startY + (gridSize*repetitions*dir)); +}