All 1990 entries now compile!
My first 41st, 51st and 29th (all depending on the base) birthday updates (possibly more will follow but this is not a certainty). All the 1990 entries now compile! In one we used a patch from Yusuke Endoh (thank you Yusuke!) which we credited him in the README and in another we used a tip from him (use -ansi at the compiler line) to get the other to compile (again, thank you Yusuke!). We fixed the others. In the case of 1990/tbr/tbr.c the author had supplied a shorter version and we fixed that one too. Added 1990/.gitignore which has the built files of 1990 so that after doing `cd 1990 ; make all' running `git status .' will not show any untracked files.
This commit is contained in:
1 parent
7d369d8882
commit
37fb84c37c
11 files changed
+135
-94
No files matched your search
@@ -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
@@ -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
@@ -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
@@ -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
|
||||||
|
|
||||||
|
|||||||
+61
-63
@@ -1,69 +1,67 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define d define
|
#define b12(x) 12 x
|
||||||
|
#define a13(x) x 13
|
||||||
#d b12(x) 12 x
|
#define a16(x) x 16
|
||||||
#d a13(x) x 13
|
#define a32(x) x 32
|
||||||
#d a16(x) x 16
|
#define acb(x) x]
|
||||||
#d a32(x) x 32
|
#define acc(x) x}
|
||||||
#d acb(x) x]
|
#define aco(x) x:
|
||||||
#d acc(x) x}
|
#define bco(x) :x
|
||||||
#d aco(x) x:
|
#define acp(x) x)
|
||||||
#d bco(x) :x
|
#define bef(x) EOF x
|
||||||
#d acp(x) x)
|
#define aeq(x) x=
|
||||||
#d bef(x) EOF x
|
#define afo(x) x for
|
||||||
#d aeq(x) x=
|
#define age(x) x fgetc
|
||||||
#d afo(x) x for
|
#define asi(x) x stdin
|
||||||
#d age(x) x fgetc
|
#define aso(x) x stdout
|
||||||
#d asi(x) x stdin
|
#define bgt(x) >x
|
||||||
#d aso(x) x stdout
|
#define ai(x) x i
|
||||||
#d bgt(x) >x
|
#define aj(x) x j
|
||||||
#d ai(x) x i
|
#define al(x) x l
|
||||||
#d aj(x) x j
|
#define ami(x) x-
|
||||||
#d al(x) x l
|
#define bne(x) !=x
|
||||||
#d ami(x) x-
|
#define aob(x) x[
|
||||||
#d bne(x) !=x
|
#define aop(x) x(
|
||||||
#d aob(x) x[
|
#define apl(x) x+
|
||||||
#d aop(x) x(
|
#define bpu(x) fputc x
|
||||||
#d apl(x) x+
|
#define bqm(x) ?x
|
||||||
#d bpu(x) fputc x
|
#define aqm(x) x?
|
||||||
#d bqm(x) ?x
|
#define aqu(x) x'
|
||||||
#d aqm(x) x?
|
#define ase(x) x;
|
||||||
#d aqu(x) x'
|
#define awh(x) x while
|
||||||
#d ase(x) x;
|
#define axo(x) x^
|
||||||
#d awh(x) x while
|
#define a0(x) x 0
|
||||||
#d axo(x) x^
|
#define b13(x) 13 x
|
||||||
#d a0(x) x 0
|
#define b16(x) 16 x
|
||||||
#d b13(x) 13 x
|
#define b19(x) 19 x
|
||||||
#d b16(x) 16 x
|
#define b48(x) 48 x
|
||||||
#d b19(x) 19 x
|
#define a64(x) x 64
|
||||||
#d b48(x) 48 x
|
#define b66(x) 66 x
|
||||||
#d a64(x) x 64
|
#define bcb(x) ]x
|
||||||
#d b66(x) 66 x
|
#define bch(x) char x
|
||||||
#d bcb(x) ]x
|
#define bcm(x) ,x
|
||||||
#d bch(x) char x
|
#define acm(x) x,
|
||||||
#d bcm(x) ,x
|
#define bcp(x) )x
|
||||||
#d acm(x) x,
|
#define beq(x) =x
|
||||||
#d bcp(x) )x
|
#define bex(x) extern x
|
||||||
#d beq(x) =x
|
#define bi(x) i x
|
||||||
#d bex(x) extern x
|
#define bin(x) int x
|
||||||
#d bi(x) i x
|
#define bix(x) index x
|
||||||
#d bin(x) int x
|
#define bj(x) j x
|
||||||
#d bix(x) index x
|
#define bl(x) l x
|
||||||
#d bj(x) j x
|
#define alt(x) x<
|
||||||
#d bl(x) l x
|
#define bma(x) main x
|
||||||
#d alt(x) x<
|
#define bob(x) [x
|
||||||
#d bma(x) main x
|
#define boc(x) {x
|
||||||
#d bob(x) [x
|
#define bop(x) (x
|
||||||
#d boc(x) {x
|
#define bpl(x) +x
|
||||||
#d bop(x) (x
|
#define app(x) x++
|
||||||
#d bpl(x) +x
|
#define bqu(x) 'x
|
||||||
#d app(x) x++
|
#define bse(x) ;x
|
||||||
#d bqu(x) 'x
|
#define bst(x) *x
|
||||||
#d bse(x) ;x
|
|
||||||
#d bst(x) *x
|
|
||||||
|
|
||||||
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))))))))))))))))))))))))))))))
|
||||||
@@ -379,7 +379,7 @@ endif
|
|||||||
#
|
#
|
||||||
#CSTD=
|
#CSTD=
|
||||||
#CSTD= -ansi
|
#CSTD= -ansi
|
||||||
CSTD= -std=gnu90
|
CSTD= -std=gnu90 -ansi
|
||||||
|
|
||||||
# compiler bit architecture
|
# compiler bit architecture
|
||||||
#
|
#
|
||||||
|
|||||||
+12
-1
@@ -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
|
||||||
|
|
||||||
|
|||||||
+17
-14
@@ -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,23 +18,28 @@
|
|||||||
|
|
||||||
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
|
||||||
|
|
||||||
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
|
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
|
||||||
|
|||||||
+2
-2
@@ -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 ;}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user