Skip to content

Instantly share code, notes, and snippets.

@gregberger
Created February 2, 2015 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregberger/df9779c9c2b9984f3a4a to your computer and use it in GitHub Desktop.
Save gregberger/df9779c9c2b9984f3a4a to your computer and use it in GitHub Desktop.
Bitshifting experiment
int i, f=0;
int value=2;
int s=500;
void setup(){
size(s,s);
}
void draw() {
loadPixels();
while (++i < (s*s)) {
f=frameCount;
// pixels[i]=i%value<<f<<16|value;
color c =0;
pixels[i] = 100 << 16 | 25+(i*f) << 8 | 250 ;
}
updatePixels();
i=0;
}
void keyPressed(){
if(key=='a') value*=2;
println(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment