Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add megaquine.c #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

houmy555809
Copy link

This is a C quine that outputs its own code (simplified obviously, so the endlines and the quotes are not the same with it's own code. But it's the same program.) in giant letters using ASCII art. Feel free to add it to your collection.

The code is written like this.

a[58]={32570943,17333823,32287,1113663,33095199,7502980
,33094719,17333809,4198532,2099276,8661386,270604,28341
,31281,14894,32045584,16301089,31280,15218734,4339846,\
17967,17732,22186,10378,166024,32575775,2295879,6588559
,31520830,6650946,33060926,15235630,32575620,15252014,\
15252526,15324974,448512,4329476,27070835,4521984,1318\
6637,4657152,4464900,4261956,31744,4357252,1016800,128\
53516,6359110,6578438,12651596,131208,10813440,4325376,
2236546,136,8521864},b[256],i,j,k,l,n=34;char m[]="abc"
"defghijklmnopqrstuvwxyz1234567890~!%^&*()-+=[]{}; '<,"
"> ";p(c){putchar(c);}w(char s[]){for(l=0;l<1375;l+=25)
{for(i=5;--i>=0;){for(j=l;j<strlen(s)&&j<l+25;j++){for(
k=5;--k>=0;)p(3*((b[s[j]]>>i*5&31)>>k&1)+32);p(32);}p(\
10);}p(10);}}main(){m[52]=n;for(i=0;i<57;i++)b[m[i]]=a[
i];char s[]="a[58]={%s},b[256],i,j,k,l,n=34;char m[]=%"
"cabcdefghijklmnopqrstuvwxyz1234567890~!%^&*()-+=[]{};"
" '<,> %c;p(c){putchar(c);};w(char s[]){for(l=0;l<1375"
";l+=25){for(i=5;--i>=0){for(j=l;j<strlen(s)&&j<l+25;j"
"++){for(k=5;--k>=0)p(3*((b[s[j]]>>i*5&31)>>k&1)+32);p"
"(32);}p(10);}p(10);}}main(){m[52]=n;for(i=0;i<57;i++)"
"b[m[i]]=a[i];char s[]=%c%s%c;char c[512],t[1024];spri"
"ntf(c,%c%%d%c,a[0]);for(i=1;i<57;i++)sprintf(c,%c%%s,"
"%%d%c,c,a[i]);sprintf(t,s,n,n,n,s,n,n,n,n,n);w(t);}";\
char c[512],t[1024];sprintf(c,"%d",a[0]);for(i=1;i<57;i
++)sprintf(c,"%s,%d",c,a[i]);sprintf(t,s,c,n,n,n,s,n,n,
n,n,n);w(t);}/////////Megaquine by houmy555809/////////

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant