Junior the JumpingLlama

Adam Robert Swietek
Data Mining the City
1 min readSep 20, 2018

Whenever the user engages with the neighborhood via keyClick, a random block will be selected and it’s property value will grow! Junior the jumping llama is a real estate developer, so he’s always looking out for the ‘hottest’ property in the neighborhood!

r = 10
h = 100
txtsize = 25
game_over=False
lama_x, lama_y = 0,0
def makeGrid():
global r, h
grid = []
for i in xrange(r):
# Create an empty list for each row
grid.append([])
for j in xrange(r):
# Pad each column in each row with a 0
grid[i].append(0)
return grid
def setup():
global x, y, h,textsize
size(h*r, h*r)
global h, r, counter,grid
grid =makeGrid()
background(0)
def draw():
global h, r,grid,txtsize,game_over, lama_x, lama_y
for x in range(r):
for y in range(r):
fill(255,255,255)
rect(h*x, h*y, h*.80,h*.80,10)
fill(0)
textSize(txtsize)
text(grid[x][y], h*x+h/4, h*y+h/2)
if grid[x][y] == max(min(grid)):
lama_x = x*h
lama_y = y*h


if ((keyPressed) and txtsize<<50):
i = int(random(r))
j = int(random(r))
c_x = int(random(255))
c_y = int(random(255))
c_z = int(random(255))
fill(c_x,c_y,c_z)
rect(h*i, h*j, h*.75, h*.75)
print(max(max(grid)))
grid[i][j]+=1
img = loadImage('Capture.JPG')
scale(.1)
image(img,lama_x*10,lama_y*10)

# if txtsize==50:
# img = loadImage('Capture.JPG')
# image(img,0,0)


# else:
# fill(255,255,255)
# camera(mouseX, height/2, (height/2) / tan(PI/6), width/2, height/2, 0, 0, 1, 0)
# rotateX(PI/8)
# #rotateZ(-PI/6)

--

--