diff --git a/2020/endoh2/README.md b/2020/endoh2/README.md index 40324d91c..95077d875 100644 --- a/2020/endoh2/README.md +++ b/2020/endoh2/README.md @@ -26,15 +26,16 @@ make ./prog yoda.txt ./prog bear.txt -`` +``` ## Judges' remarks: -Clever use of the C99 complex data type. The spoiler.zip file contains clues -as to how some winning authors create / edit programs into ASCII shapes. +Clever use of the C99 complex data type. The [spoiler](spoiler/) directory +contains clues as to how some winning authors create / edit programs into ASCII +shapes. -With the source from the spoiler.zip file could you make the code render for a -larger terminal window? How about adding more glyphs? +With the source from the [spoiler](spoiler/) directory could you make the code +render for a larger terminal window? How about adding more glyphs? ## Author's remarks: diff --git a/2020/endoh2/spoiler.zip b/2020/endoh2/spoiler.zip deleted file mode 100644 index 29b541807..000000000 Binary files a/2020/endoh2/spoiler.zip and /dev/null differ diff --git a/2020/endoh2/spoiler/code.c b/2020/endoh2/spoiler/code.c new file mode 100644 index 000000000..153dafb38 --- /dev/null +++ b/2020/endoh2/spoiler/code.c @@ -0,0 +1,91 @@ +int*d,D[9999],N=20,L=4,n,m,k,a[3],i; +char*p,*q,S[2000]="L@X-SGD-HNBBB-AD-VHSG--XNT\x1b[2J\x1b[H",*s=S,*G="GLYPHS"; +#include +typedef/**/complex/**/double(c);c(X)[3],P,O; +c/**/B(double t){ + double s=1-t,u; + P=s*s*X[1]+2*s*t**X+t*t*X[2]+O; + u=I*P; + return+48*((s=P)+48*I)/(1 +void/**/b(double t,double u){ + double s=P=B(t)-B(u); + (s=P*(2*s-P))<1? + m=P=B((t+u)/2),k=-I*P, + m>-41&&m<39&&9 +int(main)(int(x),char**V){ + clock_t(c)=clock(); + // default message + for(d=D;m<26;m++,s++) + *s>63? + *d++=m%7*16-7*8,*d++=m/7*25,*d++=*s-64 + : + 0;; + if(V[1]){ + // read a given file + ;;;FILE*F=fopen(V[+1],"r"); + for(d=D,L=N=m=0;(x=fgetc(F))>0||fclose(F);) + if( + x>13? + 64N*3||(m=0);N++)D[N*3]-=m*8; + } + for(;i<200+L*25;i++){ + // clear the screen + for(n=0,p=S+33;n<1920;*p++=n++%80>78?10:32){} + // render the message + for(*p=x=0,d=D;x33;); + *a=a[1]=*p++; + for(;*p>33;p++) + if( + *p%2? + *a=*p,0 + : + 1 + ){ + a[2]=*p; + for(m=0;m<3;m++){ + // calculate the point on the load + k=a[m]/2-18; + q="POINTTABLE"; + for(n=POINTSTART;k--;)n+=*q++-34; + X[m]=n%XMAX+n/XMAX*I; + } + // bezier + b(0,1); + *a=a[1]=*p; + } + } + // show and wait + for(puts(s),s=S+30;(clock()-c)*10/**//*Oh,my_dear_friend.How_I've_missed_you.--C-3PO***/ +typedef/**/complex/**/double(c);c(X)[3],P,O;c/**/B(double t){double s=1-t,u;P= +s*s*X[1] +2 *s*t* *X+t *t*X [2]+O;u=I*P; +return+48*(( s=P)+ 48*I )/( 1 +void/**/b( double t,/*** * **/double u){double s=P=B(t)-B(u);(s=P +*(2*s-P)) <1?m=P=B ((t+ u)/ 2),k =- I*P, m> -41&&m<39&&9 +_No. _I_am_ IOCCC 1977 ***/ +#include/***** your father.. --DarthVader **/ /**** ****/ +int(main)(int (x), char**V){; clock_t(c)= /* */clock();;; for(d=D +;m<26;m++,s ++)*s> 63?*d++=m% 7* 16-7 *8,*d++=m/ 7*25,*d++ +=*s-64:0;; if(V[1]) {;;;FILE *F =fopen(V[+1], "r");for (d=D,L=N=m +=0;(x=/** * *** **/ fgetc(F))>0 +||fclose(F);)if(x>13?64N*3||(m=0);N++)D[N*3]-=m*8;}for(;i<200+L*25;i++){for(n=0,p=S+33;n<1920;* +p++=n++%80>78?10:32){}for(*p=x=0,d=D;x33;);*a=a[1]=*p++;for(;*p>33;p++)if(*p%2?*a=*p,0:1){a[2 +]=*p;for(m=0;m<3;m++){k=a[m]/2-18;q="/&&&##%%##.+),A$$$$'&&'&&((%-((#'/#%%#&#\ +&&#D&";for(n=2;k--;)n+=*q++-34;X[m]=n%13+n/13*I;}b(0,1);*a=a[1]=*p;}}for(puts( +s),s=S+30;(clock()-c)*10 +_No. _I_am_ IOCCC 1977 ***/ +########/***** your father.. --DarthVader **/ ########/**** ****/ +############# #### #########; ########### /* */########;; ####### +########### ###### ########## ## #### ########## ######### +########## ######## ######## ## ############# ######## ########## +######/** * *** **/ ########### +############################################################################## +############################################################################## +############################################################################## +############################################################################## +#############################################################################\ +############################################################################## +#######################################################/*Nevertellmetheodds!*/ diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 901b5d94b..b1e5997a3 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2501,6 +2501,11 @@ debugging it since it works with `-O0`. He also added the script [demo.sh](2019/karns/demo.sh) to showcase the entry a bit more easily. +## [2020/endoh2](2020/endoh2/prog.c) ([README.md](2020/endoh2/README.md)) + +Cody copied the files from the spoiler.zip file that was password protected with +a password that was no longer known from his preview of 2020. + ## [2020/endoh3](2020/endoh3/prog.c) ([README.md](2020/endoh3/README.md)) Cody fixed the script [run_clock.sh](2020/endoh3/run_clock.sh) which gave a