""" Moving squares using lists by Rory Solomon For Code Toolkit: Python Eugene Lang College, Fall 2020 """ def setup(): size(500, 500) stroke(50, 50, 250) rectMode(CENTER) global x, y, s, c x = [] y = [] s = [] c = [] i = 0 while i <= 10: x.append(100+i*25) y.append(200) s.append( random(10,25) ) c.append( color( random(0,255), random(0,255), random(0,255) ) ) i = i + 1 def draw(): background(255) i = 0 while i <= 10: fill(c[i]) rect(x[i], y[i], s[i], s[i]); x[i] = x[i] + random(-5,5) y[i] = y[i] + random(-5,5) i = i + 1