# noise.py
from Processing import *

window(500, 300)
background(0)

# Delay all screen updates
# until redraw is called
immediateMode(False)

# Generate the color white
white = color(255)

def makeNoise():
    background(0)

    loadPixels()
    for i in range(5000):
        x = int(random(500))
        y = int(random(300))
        setPixel(x, y, white)
    updatePixels()

    # Render current sketch window
    redraw()
    #delay(500)

# Generate 1000 frames of random noise
for i in range(1000):
    makeNoise()
