Friday, May 6, 2011

Programming with Processing - #1

Right now I am playing around with the processing language seeing what I can do with it so I will probably be posting little code snippets every couple hours or so. Here's one I just wrote up that changes your background from black to white with every color in the gray scale in between.

int c;
void setup(){
  size (400, 400);
}
void draw(){
  background(c);
  c = c + 1;
  if (c > 255){
    noLoop();}
}

Also I finally figured what a bit means, apparently it is a measurement of one binary digit. 8 bits make a byte. All possible combinations in an eight digit binary statement comes out to 256. On the grey scale it starts at 0 and ends at 255. So that's a little explanation on what a bit is and how this simple program works.

No comments:

Post a Comment