p5 tweets

constrains - i love them. inspired by abe's twitter experiments, i've also played with creating small one line processing programs that are 140 characters long.

below is a video of number 0002, the twitter code tweets and screenshots. note that many but not all are animations. copy and paste the lines into processing (2.0) to try them out.

p5tweet0002 from redFrik on Vimeo.

//--0001

int i;noStroke();size(999,900);for(i=0;i<999;i++){fill(255,0,0,9);rect(i%99,i,i,i);}for(i=0;i<999;i++){fill(0,200,0,3);rect(i,i,i,i);}// #p5

//--0002

int j,i=0;void setup(){size(1200,900,P3D);frameRate(999);}void draw(){for(j=0;j<99;)rect(i++%(1199-j++),int(i/99)%(999-j),i%12,j%16);}// #p5

//--0003

int s=900,j,i=j=0;void setup(){size(s,s);fill(0,9);textSize(80);}void draw(){text(i+j,(sin(i++)/3+0.3)*s,(cos(j+++(i/4e3))/3+0.5)*s);}// #p5

//--0004

int s=900,j,i=j=0;void setup(){size(s,s);stroke(255,9);fill(9,3);}void draw(){quad(i++,j++,j,i,s-i,i-50,s-j,j);i=(i<<j%4)%1200;j=j%s;}// #p5

//--0005

int s=900,i=0;void setup(){size(s,s,P3D);stroke(255,0,0);fill(10,4);}void draw(){translate(i++%s,s/2);rotate(float(i)/s);sphere(i%s);}// #p5

//--0006

int s=900;float i=0;void setup(){size(s,s,P3D);stroke(99,9);fill(0,2);}void draw(){translate(i++%s,s/2);rotate(cos(i/50));box(i%s/3);}// #p5

//--0007

background(0);noStroke();for(float i=0;i<99;i=i+0.0252){size(1200,900,P3D);fill(255,0,0,60);translate(i+9,i);rotate(i*1.8);sphere(i);}// #p5

//--0008

void setup(){size(1600,900);background(255);}void draw(){textSize(millis()%1200);fill(second()*4,0,0,second());text(millis(),10,880);}// #p5

//--0009

float j,i=0;void setup(){size(1200,900,P3D);}void draw(){for(j=0;j<133;j++){rect(9*j+1,sin((i+++j)*0.75/cos(j/99)/5e3)*99+450,9,9);};}// #p5

//--0010

float i,k=450;void setup(){size(900,900,P3D);textSize(k);}void draw(){translate(k,k);fill(i%1*k/2,60);rotate(i+=+.01);text("$",99,0);}// #p5

//--0011

int i,j,k=1200;void setup(){size(k,900);fill(255,200);}void draw(){background(0);for(i=0;i<8e3;)text(i++*j/k%k,i%131*9,i/131*16);j++;}// #p5

//--0012

int j=200,i=900;size(j*6,i,P3D);lights();translate(700,540);for(i=1;i<j;){fill(i/2,50);rotate(j/i);translate(i,i,-2.7);sphere(i+++j);}// #p5

//--0013

int j=480,i=900;size(j*3,i,P3D);noStroke();lights();translate(660,j);for(i=1;i<j;){fill(i,0,0,10);rotate(i/4e4,1.1,2.2,3.3);box(i++);}// #p5

//--0014

int s=900,i=0;void setup(){size(1200,s,P3D);}void draw(){translate(600,450);rotateX(i*.0021);fill(i++%256,30);sphere(sin(i*.0014)*s);}// #p5

//--0015

int i,s=900;void setup(){size(s,s);frameRate(1e4);stroke(255,25);}void draw(){fill(i++%89,0,0,127);rect(i%90*9,i%91*9,i*i%92,i*i%93);}// #p5

//--0016

int i,s=900,t=1200;void setup(){size(t,s);noStroke();}void draw(){fill(i++%256,25);quad(i%t,i/3%s,i/4%t,i%s,i/5%t,i/4%s,i/3%t,i/2%s);}// #p5

//--0017

int t=0;void setup(){size(900,900);background(0);stroke(255,9);}void draw(){translate(450,450);line(sin(t)*421,cos(t++)*400,t%9,t%9);}// #p5

//--0018

int s=900;size(1600,s);fill(255,9);while(s>9){rotate(1e-3);arc(s+420,s,s,s,0,7);arc(1000-s,s+100,s,s,0,7);arc(s+500,400-s,s,s--,0,4);}// #p5

//--0019

int i,j,s=900;void setup(){size(s,s,P3D);smooth(8);}void draw(){stroke(i);line(i,j,s-j,i);if(j%5<1){i=(i+1)%s;}if(i%11<1){j=(j+i)%s;}}// #p5

//--0020

int s=900;void setup(){size(1200,s,P3D);}void draw(){fill(s,50);translate(sin(s)*110+600,cos(s)*99+450);rotate(s);box(s);s=(s+1)%900;}// #p5

p5tweet0001p5tweet0002p5tweet0003p5tweet0004p5tweet0005p5tweet0006p5tweet0007p5tweet0008p5tweet0009p5tweet0010p5tweet0011p5tweet0012p5tweet0013p5tweet0014p5tweet0015p5tweet0016p5tweet0017p5tweet0018p5tweet0019p5tweet0020