Skip to content

Instantly share code, notes, and snippets.

@da3mon
Forked from nakajima/leet c codes.c
Created December 5, 2008 18:08
Show Gist options
  • Save da3mon/32426 to your computer and use it in GitHub Desktop.
Save da3mon/32426 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#define M 7
#define m malloc
#define r rand
#define e exit
#define f free
#define g signal
#define t printf
#define j sizeof(char)
const char *c="#include <stdio.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#define M 7\n#define s sizeof\n#define m malloc\n#define r rand\n#define e exit\n#define f free\n#define g signal\nvoid h(int x){t(\"\\n//IT'S A TRAP!!!\\n%s\",c);e(0);}int main(){int i=1,z;char *u,*p;g(SIGINT,h);while(i>=0){z=((r()%30)+1)* j;u=m(z);p=u;while(p<u+s)*p++='u';*p='\\0';t(\"\\e[3%1$dm\\e[3%2$dm\\e[7mf%4$*3$sck\\e[0m\",i,z%M+1,z,u);i=r()%M;f(u);}}";
void h(int x){t("\n//IT'S A TRAP!!!\n%s",c);e(0);}int main(){int i=1,z;char *u,*p;g(SIGINT,h);while(i>=0){z=((r()%30)+1)*j;u=m(z);p=u;while(p<u+z)*p++='u';*p='\0';t("\e[3%1$dm\e[3%2$dm\e[7mf%4$*3$sck\e[0m",i,z%M+1,z,u);i=r()%M;f(u);}e(0);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment