Andy Best had a fun idea last week: write Processing sketches inside of a tweet. Here's his original tweet promoting the idea: @peterkirn How about a whole processing sketch in 140 characters?, and his first attempt: int c,f;void setup(){size(640,480);c=0;f=255;colorMode(HSB);}void draw(){background(color(c,f,f));ellipse(320,240,c,c);c=(c++>255)?0:c;}. He then posted some more on his Twitter feed as well as on his blog.

So last Friday, we decided to take him up on his offer and explore Twetching™ during our Friday meetup at the Atelier Hypermédia.


Here are a few examples of code with links to their authors:

float i;PImage a=loadImage("<a href="","jpg">","jpg</a>");void draw(){i+=0.01;translate(50,50);rotate(i);scale(sin(i)<em>2);image(a,-250,-250);} //[@destaouel](
import ddf.minim.</em>;AudioPlayer player;Minim minim;minim=new Minim(this); player=minim.loadFile("<a href=""></a>");; //[@FlorentDeloison](
float x,y,t;int h=100;void setup(){size(h,h);h/=2;t=0;}void draw(){x=h<em>(sin(9</em>t+1)+1);y=h<em>(sin(8</em>t)+1);point(x,y);t+=0.01;t%=TWO_PI;} //[@benoitespinola](
int c;void draw(){frameRate(c%120+1);background(++c%2==0?0:255);} //[@tomekjarolim](
void draw(){for(int i=3;i<500; i+=random(0,i)){rect(3+i,i,i%24,i%34);}} //[@budoubuda](
float x=2,i=random(1),y=2,j=random(1);void draw(){background(0);ellipse(x+=i,y+=j,10,10);if((x>99)||(x<1))i=-i;if((y>99)||(y<1))j=-j;} //[@benoitespinola](
float j;void setup(){size(99,99,P3D);}void draw(){j=second();rotateZ(j);translate(j,j);fill(j<em>4,j</em>3,j<em>2,j);box(10);} //[@FlorentDeloison](
float i,j;void setup(){size(99,99,P3D);}void draw(){j=random(0.1,1);rotateZ(i+=0.1+j%1); translate(i+j,i+j);fill(j</em>300);box(10<em>j);} //[@FlorentDeloison](
PFont f=createFont("Serif",25);background(0);textAlign(CENTER);textFont(f);text("vendredi 13 février 1984",1,1,99,99); //[@destaouel](
void draw(){for(int i=0;i<500; i++){rect(3+i,random(0,100),10+i,10);}} //[@budoubuda](
int u=100;int v=0;void setup(){size(u,u,P3D);}void draw(){background(0);v=++v%u;for(int i=0;i<1000;i++){curve(0,50,i,i</em>2+v,i<em>4,i</em>2+v,u,u);}} //[@AmmmO](
void draw(){for(int i=0;i<width;i++){colorMode(HSB);noStroke();fill(random(255),255,255);ellipse(random(width), random(height),4,5);}} //[@ destaouel ](
int x,y;int c=-16777216;void draw(){frameRate(600);if(c>-1)c=-1;stroke(c);point(x,y);c++;x++;if(x>100){x=0;y++;}if(y>100)y=0;} //[@tomekjarolim](
void draw(){background(0);for(int i=0;i<100;i=i+2){stroke (random (0,255),random (0,255),random (0,255));line (i,i,i,1);line (i,i,1,i);}} //[@FlorentDeloison](
int i;void draw(){color[]c=new color[3];c[0]=color(255,0,0);c[1]=color(0,255,0);c[2]=color(0,0,255);background(c[i]);i=++i%3;} //[@tomekjarolim](
int c=-16777216;void draw(){if(c>-1)c=-1;background(c);c++;} //[@tomekjarolim](
PImage i=loadImage("<a href="","jpg">","jpg</a>");void setup(){size(743,1155);image(i,0,0);rect(315,335,40,1);} //[@abstractmachine](
void draw(){colorMode(HSB);stroke(millis()%360,28*9,255);line(mouseX,mouseY,pmouseX,pmouseY);copy(0,0,width,height,-5,-5,width+9,height+9);} //[@abstractmachine](
String[] s=loadStrings("<a href=""></a>");println(s); //[@abstractmachine](


The whole process was a lot of fun, and an excellent pedagogic exercise. We only played around for about an hour, which was probably enough. But I have a feeling we will be doing more « exercises » like this in the future. We do a lot of theory in class, and try to mix that up with play, technical information, project critique, and open discussions. Since what the Atelier Hypermédia basically does is treat code as a « plastic » material, useable in any artistic context (i.e. considering the code itself a possible form of artistic exploration), games like this are really what we are all about. But I was struck by the level of mastery students displayed of the basic rules of Java syntax, and the collective part of the session was a real eye-opener on how good the students have gotten at collective coding. Talking about code is a Good Thing™®, coding with ten or more hands in and Even Better Thing™®. Just afterwards we had a great session with a young artist presenting her project, the exercise being: how would you develop her installation ? There too, the students showed a great capacity at collectively designing the project, even when discussing the complex details of the code. The trick, apparently, is playing such arcane and thick subjects fast and loose, and thereby ignoring the preciousness of the form itself of the code, and doing it collectively, and as a form of play. It's an intellectual bait and switch which in the end allows for a rigorous form of play.