Skip to content

Instantly share code, notes, and snippets.

@nataliefreed
Forked from anonymous/TinkerableArray.pde
Last active August 29, 2015 13:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nataliefreed/8806921 to your computer and use it in GitHub Desktop.
Sketch for experimenting with image arrays in Processing.
int rows = 10;
int columns = 12;
int[] circles = new int[rows*columns];
int index;
int spacing = 50;
int circleSize = 6;
void setup()
{
circles[16] = 255;
size(500, 500);
background(200);
for(int i=0;i<rows;i++)
{
for(int j=0;j<columns;j++)
{
fill(circles[index]);
ellipse(j*spacing, i*spacing, circleSize, circleSize);
index++;
}
}
}
void draw()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment