Grid
Published in
1 min readSep 19, 2018
def setup():
size(800, 800)x = 20
y = 20
squaresize = 35
spacing = 5def draw():
for row in xrange(0, 20):
for column in xrange(0, 20):
x = 20
y = 20
squaresize = 35
spacing = 5
fill(200, 120, 140)
stroke(200, 120, 140)
if mouseX < 400 and mouseY <400:
ellipse(x + column * (squaresize + spacing), y + row * (squaresize + spacing), 15, 15)
if mousePressed:
fill(140, 140, 230)
stroke(140, 140, 230)
if mouseX < 400 and mouseY <400:
ellipse(x + column * (squaresize + spacing), y + row * (squaresize + spacing), 15, 15)
else:
ellipse(x + column * (squaresize + spacing), y + row * (squaresize + spacing), squaresize, squaresize)