Snaketown

Tiger Tian
Data Mining the City
2 min readSep 12, 2018

Draw a 12cm by 6cm rectangular region. Draw 4 parallel lines starting from the upper side of the rectangular region, with an interval of 2.5 cm. Draw another 4 parallel lines 0.5cm below the other lines. Draw rectangular shapes adjacent to those “roads”. Place an ellipse in the center of the rectangular region as the “park”.

background (192,64,0)
size(500,500)

def drawCenter (centerX, centerY, centerWidth, centerHeight):
ellipse (centerX, centerY, centerWidth, centerHeight)
i=140
while i<400:
fill(0, 205, 0)
drawCenter (i, 210, 80, 50)
i=i+100
fill(0, 205,0)
def drawline (X1, Y1, X2, Y2):
line (X1, Y1, X2, Y2)

stroke(255)
i = 80
while i<341:
drawline (70, i, 400, i)
i=i+60
i = 100
while i<341:
drawline (70, i, 400, i)
i=i+60
drawline (400, 80, 420, 80)drawline (400, 160, 420, 160)drawline (400, 200, 420, 200)drawline (400, 280, 420, 280)line (400, 100, 400, 140)
line (400, 220, 400, 260)
line (420, 80, 420, 160)
line (420, 200, 420, 280)
line (70, 160, 70, 200)
line (50, 140, 50, 220)
line (50, 260, 50, 340)
line (70, 280, 70, 320)
line (50, 140, 70, 140)
line (50, 220, 70, 220)
line (50, 260, 70, 260)
line (50, 340, 70, 340)
def drawHouse (houseX, houseY, houseWidth, houseHeight):
rect(houseX, houseY, houseWidth, houseHeight)
fill (0, 0, 255)
i = 100
while i < 341:
drawHouse(i, 62, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 103, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 122, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 163, 30, 15)
i = i+40

i = 100
while i<341:
drawHouse(i, 242, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 283, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 302, 30, 15)
i = i+40
i = 100
while i<341:
drawHouse(i, 343, 30, 15)
i = i+40
#def draw():
# global f
# textFont (f, 16)
# text("Hellow Strings!", 10, 100)

--

--