import java.util.*; int size = 250; int weight = 20; int cellSize = 20; int gridSize = 5; 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)); } class Grid { grid = int[gridSize][gridSize]; void fillGrid() { // pick a random empty cell int X = int(random(0, gridSize)); int Y = int(random(0, gridSize)); // pick a length for the line int len = int(random(0, 5)); // choose a direction to extend the 'head' of the line from int dir = int(random(0, 4)); // repeat until length of line is reached // repeat until grid is filled } } class Line { LinkedList line = new LinkedList(); void add(int point) { line.add(point); } void draw() { // for each point in the list // draw a line for each adjacent point // translate it to the screen position } }