Central Garden(Jianqi Li)

Jianqi Li
Data Mining the City
1 min readSep 11, 2018
Draft

Rules

1 Create 9 big squares.

2 Create 9 small squares in each big squares.

3 Remove the central small.

def setup():
size(500, 500)
fill(0)#this is black

global road, blocksPerNeighborhood, blocksPerRow, blockLength, houseSetbacks, houseSize, houseQuantity, housePerRow

road = 25
blocksPerNeighborhood = 9
blocksPerRow = int(sqrt(blocksPerNeighborhood))
blockLength = int((width/blocksPerRow)-road)
houseSetbacks = 9
houseQuantity = 9
housePerRow = int(sqrt(houseQuantity))
houseSize = int((blockLength/housePerRow)-houseSetbacks)

def draw():
background(255)
#make blocks
for b in range(blocksPerNeighborhood):
fill(0, 150, 50)
stroke(50, 50, 50)
strokeWeight(3)
col = b % blocksPerRow
row = b / blocksPerRow
xCol = col*(blockLength+road)
yCol = row*(blockLength+road)
rect(xCol,yCol,blockLength,blockLength)
for c in range(houseQuantity):
fill(0)
noStroke()
colhouse = c % housePerRow
rowhouse = c / housePerRow
xColhouse = colhouse*(houseSize+houseSetbacks)
yColhouse = rowhouse*(houseSize+houseSetbacks)
if colhouse <> 1 or rowhouse <> 1:
rect(xColhouse+xCol,yColhouse+yCol,houseSize,houseSize)

Jianqi Li

--

--