Skip to content

Instantly share code, notes, and snippets.

@prozacgod
Created May 4, 2015 16:40
Show Gist options
  • Save prozacgod/b45283d20c754e199398 to your computer and use it in GitHub Desktop.
Save prozacgod/b45283d20c754e199398 to your computer and use it in GitHub Desktop.
unicode version of my previous sig.c, 120x32 pixel grid using unicode block chars. (less obfuscation)
#include <stdio.h>
char s[120*32];
const char * _S[] = {" ","▘","▝","▀","▖","▌","▞","▛","▗","▚","▐","▜","▄","▙","▟","█"};
void st(int x,int y) {if(((y)>=0)&&((y)<32)&&((x)>=0)&&((x)<120))s[(y)*120+(x)]=1;}
char gt(int x,int y) {return s[(y)*120+(x)];}
char S[45]={0,3,7,10,14,17,21,24,28,31,34,37,41,44,47,50,53,56,59,62,64,67,69,72,74,77,79,81,83,85,87,88,90,91,93,94,95,96,97,98,98,99,99,100,100};
int hs(int a){return a<90?S[a/2]:S[44-((a-90)/2)];}
int sn(int a){return a%360<180?hs(a%180):-hs(a%180);}
int PZ[] = {0x7ffe,0x8001,0x8001,0x7f39,0x0129,0x0139,
0x0101,0x0101,0x00fe,0x7ffe,0x8001,0x8001,0x7f39,0x0329,0x7c39,0x8001,0x8301,
0x7cfe,0x7ffe,0x8001,0x8001,0x8ff1,0x9009,0x8ff1,0x8001,0x8001,0x7ffe,0x7c0e,
0x8311,0x80d1,0x8031,0x8001,0x8c01,0x8b01,0x88c1,0x703e,0x7ffe,0x8001,0x8001,
0x7f39,0x0129,0x7f39,0x8001,0x8001,0x7ffe,0x7ffe,0x8001,0x8001,0x8ff1,0x9009,
0x9009,0x9009,0x9009,0x6006,0x7ffe,0x8001,0x8001,0x9ff1,0x9509,0x9d09,0x8109,
0x8109,0x7e06,0x7ffe,0x8001,0x8001,0x8ff1,0x9009,0x8ff1,0x8001,0x8001,0x7ffe,
0x7ffe,0x8001,0x8001,0x9ff9,0x8811,0x87e1,0x4002,0x2004,0x1ff8};
int f,i,j,k,y,x,z;
void zb(int* gl,int xx,int yy,int zz,int aa) {
for (x=0;x<(9*zz)/100;x++) {
for (y=0;y<(16*zz)/100;y++) {
int zx=x-(9*zz/200);
int zy=y-(16*zz/200);
int tx=((zx*sn(aa+90))-(zy*sn(aa)))/100;
int ty=((zx*sn(aa))+(zy*sn(aa+90)))/100;
tx+=xx;
ty+=yy;
if ((gl[(x*100/zz)]>>(y*100/zz))&1)
st(tx,ty);
}
}
}
int main() {
f = 0;
int zm = 0;
while(1) {
for (z=0; z<120*32; z++) {
s[z]=0;
}
if (f!=0)
printf("\x1b[16A\r");
for(z=0;z<120;z+=2) {
st(z,(160-sn((z*10)+((f*6)/4)))/10);
}
int jx;
for (jx=0;jx<=9;jx++){
y=sn(f+jx*50)/15;
zb(&PZ[jx*9],jx*25-(-200+((f%4500)/10)),16+y,250+(sn(f)),360+sn(f+(jx*120))/10);
}
for(y=0;y<16;y++) {
for(x=0;x<60;x++) {
int xx=x*2,yy=y*2;
int idx =
gt(xx,yy) |
(gt(xx+1,yy) << 1) |
(gt(xx,yy+1) << 2) |
(gt(xx+1,yy+1) << 3);
printf("%s", _S[idx]);
}
putchar('\n');
}
usleep(2000);
f++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment