Recently, I found a contest which required people to write 3 Tweetable (meaning 140 characters or less) function bodies for the red, green, and blue values of a 1024x1024 image. The results are astonishing…
Let me show you some of the masterpieces:
Work from Martin Büttner. Codes as follows:
unsigned char RD(int i,int j){ #define r(n)(rand()%n) static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):RD((i+r(2))%1024,(j+r(2))%1024):c[i][j]; } unsigned char GR(int i,int j){ static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):GR((i+r(2))%1024,(j+r(2))%1024):c[i][j]; } unsigned char BL(int i,int j){ static char c[1024][1024];return!c[i][j]?c[i][j]=!r(999)?r(256):BL((i+r(2))%1024,(j+r(2))%1024):c[i][j]; }
Another work from Martin Büttner. Codes as follows:
unsigned char RD(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return log(k)47; } unsigned char GR(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return log(k)47; } unsigned char BL(int i,int j){ float x=0,y=0;int k;for(k=0;k++<256;){float a=xx-yy+(i-768.0)/512;y=2xy+(j-512.0)/512;x=a;if(xx+yy>4)break;}return 128-log(k)*23; }
Work from Manuel Kasten. Codes as follows:
unsigned char RD(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255pow((n-80)/800,3.); } unsigned char GR(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255pow((n-80)/800,.7); } unsigned char BL(int i,int j){ double a=0,b=0,c,d,n=0; while((c=aa)+(d=bb)<4&&n++<880) {b=2ab+j8e-9-.645411;a=c-d+i8e-9+.356888;} return 255*pow((n-80)/800,.5); }
Work from Eric Tressler. Codes are as follows:
unsigned char RD(int i,int j){ #define A float a=0,b,k,r,x #define B int e,o #define C(x) x>255?255:x #define R return #define D DIM R BL(i,j)(D-i)/D; } unsigned char GR(int i,int j){ #define E DM1 #define F static float #define G for( #define H r=a1.6/D+2.4;x=1.0001b/D R BL(i,j)(D-j/2)/D; }
Has this inspired you? Is there any kind of creative contest you would like Anker to hold in the future? Please leave me a comment, I’m looking forward to hearing your thoughts!