We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm attempting to do Dan Shiffman's Pixel Array in Python but get the error after just a few iterations. Here's the code:
inc = 0.01 def setup(): size(6, 5) def draw(): # background(50) global inc yoff = 0 loadPixels() for y in range(height-1): xoff = 0 for x in range(width): idx = (x + y * width) * 4 r = noise(xoff, yoff) * 255 pixels[idx+0] = r pixels[idx+1] = r pixels[idx+2] = r pixels[idx+3] = 255 xoff += inc yoff += inc updatePixels()
The error appears here:
pixels[idx+2] = r
Thanks for any help!