Skip to content

Instantly share code, notes, and snippets.

@DingoEatingFuzz
Created December 2, 2014 10:06
Show Gist options
  • Save DingoEatingFuzz/40dd0b9c81bf489fc18d to your computer and use it in GitHub Desktop.
Save DingoEatingFuzz/40dd0b9c81bf489fc18d to your computer and use it in GitHub Desktop.
def setup():
global seed
seed = 0
size(500, 500)
frameRate(4)
colorMode(HSB)
def draw():
global seed
background(0, 0, 245)
noStroke()
fill(0, 0, 255)
rect(30, 30, 440, 440, 15, 15, 15, 15)
tileSize = 400 / 5
fill(random(255), random(25, 75), random(175, 225))
for i in range(5):
for j in range(3):
if seed & (1 << (i * 3 + j)):
rect(50 + tileSize * j, 50 + tileSize * i, tileSize, tileSize)
rect(50 + tileSize * (4 - j), 50 + tileSize * i, tileSize, tileSize)
seed = (seed + 1) % 2**15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment