Week 9

JIANWEI LI
Data Mining the City
1 min readNov 10, 2017
Randomly Pop-up images
import time
def setup():
global a,c
size(500,500,P2D)
a = loadImage(“baozou.jpg”)
c = loadImage(“oh.jpg”)
def draw():
time.sleep(0.1)
global a,c
x = random(0,width)
y = random(0,height)
r = round(random(0,255))
g = round(random(0,255))
b = round(random(0,255))
noStroke()
if mouseX<width/2:
image(a,x/2,y/2)
else:
image(c,x/2,y/2)

--

--