Merge pull request #10 from xexyl/birthday-updates

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-02-22 13:45:17 -08:00
commit 4bca2a7f5f
15 files changed
+79 -36

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
baruch/baruch
cmills/cmills
dds/dds
dg/dg
jaw/atob
jaw/jaw
jaw/zcat
pjr/pjr
scjones/scjones
stig/o
stig/o.c
tbr/tbr
theorem/fibonacci
theorem/fibonacci.c
theorem/sorter
theorem/sorter.c
theorem/theorem
westley/westley
+10 -1
View File
@@ -10,12 +10,16 @@
make all make all
NOTE: This entry may not compile when using modern compilers.
### To run ### To run
./dds ./dds
NOTE: this entry uses `gets()` so you might get a warning when compiling and
running this entry.
## Judges' comments ## Judges' comments
Give the following lines as input: Give the following lines as input:
@@ -25,6 +29,11 @@
Be sure not to run out of fuel! Be sure not to run out of fuel!
Modern compilers could not compile this entry but Yusuke Endoh supplied a patch
which lets it compile. Thank you Yusuke!
## Author's comments ## Author's comments
This is the DDS-BASIC Interpreter (Version 1.00). This is the DDS-BASIC Interpreter (Version 1.00).
+2 -2
View File
@@ -16,9 +16,9 @@ X'R':B[2]!='M'&&(l=*--C)X'I':B[1]=='N'?gets(p=B),P[*d]=S():(*(q=Q(B,"TH"))=0,p
=B+2,S()&&(p=q+4,l=S()-1))X'P':B[5]=='"'?*d=0,puts(B+6):(p=B+5,printf("%d\n",S =B+2,S()&&(p=q+4,l=S()-1))X'P':B[5]=='"'?*d=0,puts(B+6):(p=B+5,printf("%d\n",S
()))X'G':p=B+4,B[2]=='S'&&(*C++=l,p++),l=S()-1 X'F':*(q=Q(B,"TO"))=0;p=B+5;P[i ()))X'G':p=B+4,B[2]=='S'&&(*C++=l,p++),l=S()-1 X'F':*(q=Q(B,"TO"))=0;p=B+5;P[i
=B[3]]=S();p=q+2;M[i]=S();L[i]=l X'N':++P[*d]<=M[*d]&&(l=L[*d]);}else p=B+2,P[ =B[3]]=S();p=q+2;M[i]=S();L[i]=l X'N':++P[*d]<=M[*d]&&(l=L[*d]);}else p=B+2,P[
*B]=S();l++;}X'L':N printf(I)X'N':N free(m[i]),m[i]=0 X'B':_ 0 t('S',5,"w",N *B]=S();l++;}X'L':N printf(I)X'N':N(free(m[i]),0),m[i]=0 X'B':_ 0 t('S',5,"w",N
fprintf(f,I))t('O',4,"r",while(fgets(B,R,f))(*Q(B,"\n")=0,G()))X 0:default:G() fprintf(f,I))t('O',4,"r",while(fgets(B,R,f))(*Q(B,"\n")=0,G()))X 0:default:G()
;}_ 0;}G(){l=atoi(B);m[l]&&free(m[l]);(p=Q(B," "))?strcpy(m[l]=malloc(strlen(p ;}_ 0;}G(){l=atoi(B);m[l]&&(free(m[l]),0);(p=Q(B," "))?strcpy(m[l]=malloc(strlen(p
)),p+1):(m[l]=0,0);}O(S,J,'=',==,'#',!=)O(J,K,'<',<,'>',>)O(K,V,'$',<=,'!',>=) )),p+1):(m[l]=0,0);}O(S,J,'=',==,'#',!=)O(J,K,'<',<,'>',>)O(K,V,'$',<=,'!',>=)
O(V,W,'+',+,'-',-)O(W,Y,'*',*,'/',/)Y(){int o;_*p=='-'?p++,-Y():*p>='0'&&*p<= O(V,W,'+',+,'-',-)O(W,Y,'*',*,'/',/)Y(){int o;_*p=='-'?p++,-Y():*p>='0'&&*p<=
'9'?strtol(p,&p,0):*p=='('?p++,o=S(),p++,o:P[*p++];} '9'?strtol(p,&p,0):*p=='('?p++,o=S(),p++,o:P[*p++];}
+7 -5
View File
@@ -18,16 +18,18 @@
## Judges' comments ## Judges' comments
Some C preprocessors get confused about single quotes in certain cases. Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line: In particular, the following source line:
Cb12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A)))))))))))))))))))))))))))))) b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
may need to be changed to: sometimes has to be changed to:
Cb12(ase(bco(acp(bi(acp(bcp(acp(bpl('A')))))))))))))))))))))))))))) b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
if the C preprocessor botches single quotes in cpp expansions, which we have
done for the wider audience.
if your C preprocessor botches single quotes in cpp expansions.
## Author's comments ## Author's comments
+1 -1
View File
@@ -63,5 +63,5 @@
bma(acp(bop(app(bcp(ai(boc(ase(bch(a16(bl(alt(bob(ai(b66(ase(bcb(a0(bcm(aeq(bst(acb(bj(a64(bse(aob(bin(al(bi(aeq(bse(ai(bex(aop(bch(afo(bst(ase(bix(()))))))))))))))))))))))))))))))))))))))) bma(acp(bop(app(bcp(ai(boc(ase(bch(a16(bl(alt(bob(ai(b66(ase(bcb(a0(bcm(aeq(bst(acb(bj(a64(bse(aob(bin(al(bi(aeq(bse(ai(bex(aop(bch(afo(bst(ase(bix(())))))))))))))))))))))))))))))))))))))))
bl(ai(bob(aob(bi(al(bcb(aop(beq(apl(b13(a13(bpl(aeq(bop(acb(bl(bob(a32(bi(bpl(apl(b16(bcb(ai(beq(b19(aob(bpl(bop(l)))))))))))))))))))))))))))))) bl(ai(bob(aob(bi(al(bcb(aop(beq(apl(b13(a13(bpl(aeq(bop(acb(bl(bob(a32(bi(bpl(apl(b16(bcb(ai(beq(b19(aob(bpl(bop(l))))))))))))))))))))))))))))))
bpl(acp(b48(acp(asi(bcb(aop(beq(age(bop(aeq(bi(ai(bgt(aop(b12(aop(bqm(awh(b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A)))))))))))))))))))))))))))))) bpl(acp(b48(acp(asi(bcb(aop(beq(age(bop(aeq(bi(ai(bgt(aop(b12(aop(bqm(awh(b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
bne(acc(bef(ase(bcp(acp(aso(bpu(acm(ai(bop(aco(bop(acb(bj(al(beq(ami(bix(aj(axo(bop(a16(aob(bl(al(aqm(bcm(acp(acp(i)))))))))))))))))))))))))))))) bne(acc(bef(ase(bcp(acp(aso(bpu(acm(ai(bop(aco(bop(acb(bj(al(beq(ami(bix(aj(axo(bop(a16(aob(bl(al(aqm(bcm(acp(acp(i))))))))))))))))))))))))))))))
+1 -1
View File
@@ -344,7 +344,7 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# #
#CSTD= #CSTD=
#CSTD= -ansi #CSTD= -ansi
CSTD= -std=gnu90 CSTD= -std=gnu90 -ansi
# Compiler bit architecture # Compiler bit architecture
# #
+12 -1
View File
@@ -10,7 +10,18 @@
make all make all
NOTE: This entry may not compile when using modern compilers.
Modern compilers might fail to compile this entry:
scjones.c:1:7: error: expected ';' after top level declarator
char*a??(??)=??<
^
;
but we were able to get it to compile with modern compilers by specifying the
`-ansi` flag with a tip from Yusuke Endoh. Thank you Yusuke!
### To run ### To run
+16 -13
View File
@@ -10,8 +10,6 @@
make all make all
NOTE: This entry may not compile when using modern compilers.
### To run ### To run
./tbr ./tbr
@@ -20,22 +18,27 @@
This program implements a subject a well known Un*x utility whose This program implements a subject a well known Un*x utility whose
original source was considered to be extremely obfuscated by many original source was considered to be extremely obfuscated by many
people, excluding its author. In fact, this utility one a major people, excluding its author. In fact, this utility was a major
inspiration for the formation of this contest. inspiration for the formation of this contest.
The author supplied us with a slightly smaller unformatted version The author supplied us with a slightly smaller unformatted version
of the program which we include below: of the program which we include below:
#define D ,close( #define D ,close(
char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]= char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||exit(0);r(0,0))for(;*++c;);} 32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]= r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u= *u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o? ++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D 0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;} 1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;}
e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||exit(1):5;} e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;}
Modern compilers had a problem with this entry because the exit(3) function
returns void but we were able to get it to compile by using the comma
operator which we also did in the smaller version.
## Author's comments ## Author's comments
+2 -2
View File
@@ -4,7 +4,7 @@
char *c,q [512 ],m[ 256 char *c,q [512 ],m[ 256
],*v[ 99], **u, *i[3];int f[2],p;main (){for ],*v[ 99], **u, *i[3];int f[2],p;main (){for
(m[m [60]= m[62 ]=32 ]=m[* m=124 [m]= 9]=6; (m[m [60]= m[62 ]=32 ]=m[* m=124 [m]= 9]=6;
e(-8) ,gets (1+( c=q) )|| exit (0); r(0,0) e(-8) ,gets (1+( c=q) )|| (exit (0),0); r(0,0)
)for( ;*++ c;); }r(t, o){ *i=i [2]= 0;for )for( ;*++ c;); }r(t, o){ *i=i [2]= 0;for
(u=v +98 ;m[*--c] ^9;m [*c] &32 ?i[*c (u=v +98 ;m[*--c] ^9;m [*c] &32 ?i[*c
&2]= *u,u- v^98 &&++u: &2]= *u,u- v^98 &&++u:
@@ -19,5 +19,5 @@ char *c,q [512 ],m[ 256
2 ]? 2 ]?
6 D 1),e(creat(i[2],438)): 6 D 1),e(creat(i[2],438)):
5 ,e(execvp(*u,u))):e(chdir(u[1])*2): 5 ,e(execvp(*u,u))):e(chdir(u[1])*2):
3 ;}e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||exit(1): 3 ;}e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):
5 ;} 5 ;}
+2 -2
View File
@@ -36,8 +36,8 @@
make it easier on news readers, we converted each control-L to make it easier on news readers, we converted each control-L to
a blank line. a blank line.
Some ANSI compilers will not accept '1s' as a short integer - for Some modern compilers will not accept '1s' as a short integer - for
these compilers replace the '1s' with '1'. these compilers we replaced the instances of `1s` with `1`.
## Author's comments ## Author's comments
+3 -3
View File
@@ -28,7 +28,7 @@ dear; (char)lotte--;
#define love (char*)lie - #define love (char*)lie -
love 1s *!(not= atoi(let love 1 *!(not= atoi(let
[get -me? [get -me?
@@ -90,13 +90,13 @@ get; !out; (char)*lie & 0xD0- !not) return!!
register this; switch( (char)lie register this; switch( (char)lie
[(char)lotte] -1s *!out) { [(char)lotte] -1 *!out) {
char*les, get= 0xFF, my; case' ': char*les, get= 0xFF, my; case' ':
*((char*)&lotte) += 15; !not +(char)*lie*'s'; *((char*)&lotte) += 15; !not +(char)*lie*'s';
this +1s+ not; default: 0xF +(char*)lie;}}} this +1+ not; default: 0xF +(char*)lie;}}}
get - !out; get - !out;
+1 -1
View File
@@ -59,7 +59,7 @@ And the PPM version (no additional dependencies, can read raw/ASCII PPM, writes
make prog_ppm make prog_ppm
### Building on OSX ### Building on macOS
- Thanks to Cody Ferguson for this information! - Thanks to Cody Ferguson for this information!
+1 -1
View File
@@ -40,7 +40,7 @@ You must include the following two words (separated by a space) in the subject o
<TABLE><TR> <TABLE><TR>
<TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD> <TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD>
<TD><P>&copy; Copyright 1984-2022, <TD><P>&copy; Copyright 1984-2023,
<A HREF="/judges.html">Leo Broukhis, Landon Curt Noll</A> <A HREF="/judges.html">Leo Broukhis, Landon Curt Noll</A>
- All rights reserved<BR> - All rights reserved<BR>
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD> This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
+2 -2
View File
@@ -241,7 +241,7 @@ of my entry, if anything at all?
explaining what your entry does</LI> explaining what your entry does</LI>
<LI> <LI>
how to entice it to do what it is suppoosed to do</LI> how to entice it to do what it is supposed to do</LI>
<LI> <LI>
what obfuscations are used</LI> what obfuscations are used</LI>
@@ -417,7 +417,7 @@ We began to compare notes: ''<I>You won't believe the code I am trying to
fix</I>''. fix</I>''.
And: ''<I>Well you cannot imagine the brain damage level of the code And: ''<I>Well you cannot imagine the brain damage level of the code
I'm trying to fix''</I>. I'm trying to fix''</I>.
As well as: ''<I>It more than bad code, the author really As well as: ''<I>It's more than bad code, the author really
had to try to make it this bad!</I>''. had to try to make it this bad!</I>''.
<P> <P>
+1 -1
View File
@@ -37,7 +37,7 @@ Contest </I></FONT></CENTER><BR>
<TABLE><TR> <TABLE><TR>
<TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD> <TD><a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="/png/by-sa-3.0-88x31.png" /></a></TD>
<TD><P>&copy; Copyright 1984-2022, <TD><P>&copy; Copyright 1984-2023,
<A HREF="/judges.html">Leo Broukhis, Landon Curt Noll</A> <A HREF="/judges.html">Leo Broukhis, Landon Curt Noll</A>
- All rights reserved<BR> - All rights reserved<BR>
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD> This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>