Skip to content

Instantly share code, notes, and snippets.

@mrange
Last active February 24, 2026 12:50
Show Gist options
  • Select an option

  • Save mrange/6f64a7ade0dceba12fd01adf6973a986 to your computer and use it in GitHub Desktop.

Select an option

Save mrange/6f64a7ade0dceba12fd01adf6973a986 to your computer and use it in GitHub Desktop.
Obfuscated C experiment: Nothing special
#define _GNU_SOURCE
#include<math.h>
#include<sys/ioctl.h>
#define V for(n=0;n<3;++n)
#define F c+=sprintf(b+c,
//////////////////////////////////////
// "Nothing Special"-Posix version ///
// by mrange 2026-02-22 ////
// // //
// Compile and run with: // //
// gcc -Ofast main.c -lm -w&&./a.out// //
////////////////////////////////////// //
struct winsize S;char*b;int c,i,j,n,// //
x,y,o[6],w,h;float A,B,C,O[3],P[3],R// //
[3],U[3],T,Z;main(){ioctl(1,TIOCGWINSZ //
,&S);w=S.ws_col;h=S.ws_row;h+=h;b= // //
malloc(w*h<<7);for(;T+=.05F;write(1,// //
b,c),c=0,F"\e[?25l\e[H"))for(y=0;y<h// //
;y+=2)for(x=w;x--;F"\e[38;2;%d;%d;%"// //
"dm\e[48;2;%d;%d;%dm\xe2\x96\x80",o // //
[0],o[1],o[2],o[3],o[4],o[5]))for(i=// //
2;i--;){V O[n]=0;R[0]=x-w/2;R[1]=y+i// //
-h/2;R[2]=h;A=0;V A+=R[n]*R[n];A=1/ // //
sqrtf(A);V R[n]*=A;Z=0;for(j=66;j--;// //
Z+=C){V P[n]=Z*R[n];P[2]+=T;sincosf(// //
.4F*P[2],&A,&B);C=B*P[0]+A*P[1];P[1]// //
=B*P[1]-A*P[0];P[0]=C;V P[n]-=floorf// //
(U[n]=P[n])+.5F;for(A=3;A--;)V P[n] // //
*=P[n];C=0;V C+=P[n];C=.6F*fabsf(powf( //
C,.125F)-.3F)+1E-3F;V O[n]+=(1+sinf(// //
U[0]+U[1]+n))/C;}V o[n+i*3]=255*tanhf///
(O[n]/1E4F);}} //
//////////////////////////////////////
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#define V for(n=0;n<3;++n)
#define F c+=sprintf(b+c,
/////////////////////////////////////////
// "Nothing Special"-Windows version ///
// by mrange 2026-02-22 ////
// // //
// Compile and run with: // //
// cl /O2 /fp:fast main.c /link;.\main// //
///////////////////////////////////////// //
int main(){CONSOLE_SCREEN_BUFFER_INFO S// //
;char*b;int c=0,i,j,n,x,y,o[6],w,h; // //
float A,B,C,O[3],P[3],R[3],U[3],T=0,Z; // //
SetConsoleOutputCP(65001); // //
GetConsoleScreenBufferInfo(GetStdHandle// //
(-11),&S);w=S.srWindow.Right-S.srWindow// //
.Left+1;h=S.srWindow.Bottom-S.srWindow.// //
Top+1;h+=h;b=malloc(w*h<<7);for(;T+= // //
.05F;fputs(b,stdout),c=0,F"\x1b[?25l\x1b" //
"[H"))for(y=0;y<h;y+=2)for(x=w;x--;F"\x1b" //
"[38;2;%d;%d;%dm\x1b[48;2;%d;%d;%dm\xe2" //
"\x96\x80",o[0],o[1],o[2],o[3],o[4],o[5// //
]))for(i=2;i--;){V O[n]=0;R[0]=x-w/2;R[// //
1]=y+i-h/2;R[2]=h;A=0;V A+=R[n]*R[n];A=// //
1/sqrtf(A);V R[n]*=A;Z=0;for(j=66;j--;Z// //
+=C){V P[n]=Z*R[n];P[2]+=T;A=sinf(.4F*P// //
[2]);B=cosf(.4F*P[2]);C=B*P[0]+A*P[1];P// //
[1]=B*P[1]-A*P[0];P[0]=C;V P[n]-=floorf// //
(U[n]=P[n])+.5F;for(A=3;A--;)V P[n]*=P // //
[n];C=0;V C+=P[n];C=.6F*fabsf(powf(C, // //
.125F)-.3F)+1E-3F;V O[n]+=(1+sinf(U[0]+// //
U[1]+n))/C;}V o[n+i*3]=255*tanhf(O[n]/ ////
1E4F);}} ///
/////////////////////////////////////////
@graasmund-visma
Copy link

Very cool effect. Who needs a graphics card, really?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment