Get 1989 entries to compile

There were some which cannot be compiled under clang. One entry we used
a patch from Yusuke Endoh to get the entry to compile; thank you Yusuke
for your assistance! Another one we used a patch from Yusuke (thank
you!) but I further fixed it so that it would work with clang. It had to
be done: IOCCC Tetris has to work! This was done by changing the
environment arg to main() to be a char * in main() itself rather than a
char **. Using a char ** in main() third arg got it to compile but only
one key worked with clang so I changed it to be not the third argument
but a regular char * in main(). **a (third arg) evaluated correctly but
*a[1] and onward was actually part of the environment. Again IOCCC
Tetris has to work!

I also fixed fubar to work which took a few tweaks.

README.md files were also updated.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-06 09:04:46 -08:00
1 parent b6be01bdc6
commit 9d63c37f49
23 files changed
+146 -73

No files matched your search

-2
View File
@@ -182,7 +182,6 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry is likely to fail and/or dump core on modern computers."
${RM} -f $@ ${RM} -f $@
${CP} -f fubar.sh $@ ${CP} -f fubar.sh $@
${CHMOD} +x $@ ${CHMOD} +x $@
@@ -198,7 +197,6 @@ data: ${DATA}
@${TRUE} @${TRUE}
${PROG}.orig: ${PROG}.orig.c ${PROG}.orig: ${PROG}.orig.c
@echo "NOTE: This entry is likely to fail and/or dump core on modern computers."
${RM} -f $@ ${RM} -f $@
${CP} -f fubar.orig.sh $@ ${CP} -f fubar.orig.sh $@
${CHMOD} +x $@ ${CHMOD} +x $@
+3
View File
@@ -22,6 +22,9 @@
The blank line at the beginning of the source is mandatory. The blank line at the beginning of the source is mandatory.
Do you know why? Do you know why?
With a bit of tinkering Cody Boone Ferguson got this to work on modern systems.
We thank him for his assistance!
## Author's comments ## Author's comments
In a nutshell, this is probably the slowest and most In a nutshell, this is probably the slowest and most
+6 -5
View File
@@ -1,19 +1,20 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#define QQ 1 #define QQ 1
#define TT 1 #define TT 1
#define cc main(c,v) int c; char **v;{char tt[12],qq[7]; int q=0,o=1,l=1,m=1;struct {int c;} f; #define cc int main(c,v) int c; char **v;{char tt[12],qq[7]; int q=0,o=1,l=1,m=1;struct {int c;} f;
#define ouroboros qq[6]='\0';tt[11]='\0';if(QQ==atoi(v[1])+1){(void)fprintf(stderr,"%s factorial = %d\n",v[1], TT);exit(1);}o=c+f #define ouroboros qq[6]='\0';tt[11]='\0';if(QQ==atoi(v[1])+1){(void)fprintf(stderr,"%s factorial = %d\n",v[1], TT);exit(1);}o=c+f
#define x ;while(EOF!=(o=getchar())){if(l && q=='Q' && o=='Q'){l=0;(void)getchar();(void)fread(qq,6,1,stdin);(void)printf("Q %6d",atoi(qq)+1);}else #define x ;while(EOF!=(o=getchar())){if(l && q=='Q' && o=='Q'){l=0;(void)getchar();(void)fread(qq,6,1,stdin);(void)printf("Q %6d",atoi(qq)+1);}else
if(m && q=='T' && o=='T'){m=0;(void)fread(tt,11,1,stdin);(void)printf("T %9d\n",atoi(tt)*QQ);}else {q=o;(void)putchar(o);}}exit(0);} if(m && q=='T' && o=='T'){m=0;(void)fread(tt,11,1,stdin);(void)printf("T %9d\n",atoi(tt)*QQ);}else {q=o;(void)putchar(o);}}exit(0);}
cc ouroboros.c -o x cc ouroboros.c -o x
#define zxc ;{/* #define zxc ;{/*
cat ouroboros.c | x $1 > x1 cat ./ouroboros.c | ./x $1 > x1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit exit
fi fi
mv x1 ouroboros.c mv x1 ./ouroboros.c
chmod +x ouroboros.c chmod +x ./ouroboros.c
exec ouroboros.c $1 exec ./ouroboros.c $1
exit exit
*/ */
+2 -2
View File
@@ -11,9 +11,9 @@ fi
rm -f ouroboros.c x1 x rm -f ouroboros.c x1 x
ex - <<EOF ex - <<EOF
r fubar.c r fubar.c
7,8j 8,9j
w ouroboros.c w ouroboros.c
EOF EOF
chmod +x ouroboros.c chmod +x ouroboros.c
./ouroboros.c $1 ./ouroboros.c $1
rm -f ouroboros.c x1 x #rm -f ouroboros.c x1 x
+2
View File
@@ -182,9 +182,11 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo NOTE: this compilation results in running the program itself.
${RM} -f $@ ${RM} -f $@
${CP} jar.1.sh $@ ${CP} jar.1.sh $@
${CHMOD} +x $@ ${CHMOD} +x $@
${CC} -c -o /dev/tty jar.1.c
# alternative executable # alternative executable
# #
+5 -4
View File
@@ -1,4 +1,4 @@
Strangest abuse of the rules: ## Strangest abuse of the rules:
Jari Arkko Jari Arkko
Laboratory of Information Processing Science Laboratory of Information Processing Science
@@ -7,7 +7,7 @@ Strangest abuse of the rules:
02150 Espoo 02150 Espoo
Finland Finland
Judges notes: ## Judges notes:
On many systems the compiler will not allow you to send the On many systems the compiler will not allow you to send the
object file to /dev/tty. The author suggested: object file to /dev/tty. The author suggested:
@@ -20,19 +20,20 @@ Judges notes:
cc -c jar.1.c cc -c jar.1.c
if your system has symbolic links. The shell script run if your system has symbolic links. The shell script run
by the makefile simply cats the .o file to the terminal by the Makefile simply cats the .o file to the terminal
which can be used as a last resort. which can be used as a last resort.
Abuse of the rules winners usually result in a change of the Abuse of the rules winners usually result in a change of the
rules. Starting in 1990, compiling entries must result an rules. Starting in 1990, compiling entries must result an
regular file which can be executed. regular file which can be executed.
Selected notes from the author: ## Selected notes from the author:
This program is (supposedly) the smallest C program able to This program is (supposedly) the smallest C program able to
print "Hello world.". The compilation itself produces the print "Hello world.". The compilation itself produces the
desired printout and the program need not be actually run. desired printout and the program need not be actually run.
Copyright (c) 1989, Landon Curt Noll & Larry Bassel. Copyright (c) 1989, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is All Rights Reserved. Permission for personal, educational or non-profit use is
granted provided this this copyright and notice are included in its entirety granted provided this this copyright and notice are included in its entirety
+1
View File
@@ -182,6 +182,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo NOTE: invalid input will cause this entry to dump core.
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+12 -6
View File
@@ -1,4 +1,4 @@
Best of show: ## Best of show:
Jari Arkko, Ora Lassila, Esko Nuutila Jari Arkko, Ora Lassila, Esko Nuutila
Laboratory of Information Processing Science Laboratory of Information Processing Science
@@ -7,7 +7,14 @@ Best of show:
02150 Espoo 02150 Espoo
Finland Finland
Judges notes: ## To build:
make all
NOTE: To have a chance to compile under a modern CPP, we had to
replace `#D` with `#define` and `#a` with `#include`.
## Judges' comments:
This is the most useful program entered this year. It is a This is the most useful program entered this year. It is a
rather large subset of lisp. It has no error recovery, and rather large subset of lisp. It has no error recovery, and
@@ -15,10 +22,8 @@ Judges notes:
all this functionality in such a small, densely packed program, all this functionality in such a small, densely packed program,
is impressive enough to win the Best of show award. is impressive enough to win the Best of show award.
To have a chance to compile under a modern CPP, we had to
replace `#D` with `#define`.
Selected notes from the author: ## Selected notes from the author:
This program implements a Lisp interpreter in 1465 bytes of source. This program implements a Lisp interpreter in 1465 bytes of source.
Some sophisticated features supported, eg. functionals and recursion. Some sophisticated features supported, eg. functionals and recursion.
@@ -53,6 +58,7 @@ Selected notes from the author:
(car (quote (a b c))) (car (quote (a b c)))
(cdr (cdr (quote (g h i)))) (cdr (cdr (quote (g h i))))
Please do not leave any whitespace before the first parenthesis when Please do not leave any whitespace before the first parenthesis when
you type your input, or any other unnecessary whitespace. Please try to you type your input, or any other unnecessary whitespace. Please try to
avoid any undefined variables or functions, wrong number of arguments avoid any undefined variables or functions, wrong number of arguments
@@ -61,7 +67,7 @@ Selected notes from the author:
Traditional Lisp implementations use cons cells as the main data Traditional Lisp implementations use cons cells as the main data
structure. Lists are organized of pointer chains of these cells. structure. Lists are organized of pointer chains of these cells.
In this program, an alternate representation was chosen: char*'s. In this program, an alternate representation was chosen: `char*'`s.
All list operations, including the ones in the interpreter, are All list operations, including the ones in the interpreter, are
made using string representations of the lists. These operations made using string representations of the lists. These operations
must count parentheses and skip whitespace. This leads to extremely must count parentheses and skip whitespace. This leads to extremely
+15 -17
View File
@@ -1,20 +1,18 @@
#define d define #include <stdio.h>
#d a include #include <string.h>
#a <stdio.h> #include <ctype.h>
#a <string.h> #define p char*
#a <ctype.h> #define P ,(p)
#d p char* #define T(E) !strcmp(E,"()")
#d P ,(p) #define U return
#d T(E) !strcmp(E,"()") #define W while
#d U return #define X sbrk(199)
#d W while #define z atof
#d X sbrk(199) #define e isspace
#d z atof #define D A(_)
#d e isspace #define E S(C(_))
#d D A(_) #define B(y) p y(_)p _;{
#d E S(C(_)) #define G(y,V) B(y)p i;U sprintf(i=X,"%lf",z(E)V z(S(C(D)))),i;}
#d B(y) p y(_)p _;{
#d G(y,V) B(y)p i;U sprintf(i=X,"%lf",z(E)V z(S(C(D)))),i;}
p sbrk(),*S(),*j(),*O,*H;K,Y,M=14;double p sbrk(),*S(),*j(),*O,*H;K,Y,M=14;double
z();Q(_)p _;{int V=0;W(e(*_))_++;H=_;W(V|!(e z();Q(_)p _;{int V=0;W(e(*_))_++;H=_;W(V|!(e
-1
View File
@@ -186,7 +186,6 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry requires a non-standard K&R C compiler to compile."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+11 -6
View File
@@ -1,4 +1,4 @@
Most humorous output: ## Most humorous output:
Oskar von der Luehe Oskar von der Luehe
Institut fuer Astronomie Institut fuer Astronomie
@@ -6,7 +6,13 @@ Most humorous output:
8092 Zuerich 8092 Zuerich
Switzerland Switzerland
Judges notes: ## To build:
make all
To get this to compile with a modern CPP, we had to replace `#D` with `#define`.
## Judges' comments:
Run this program using your favorite text file as input. Files Run this program using your favorite text file as input. Files
such as mailboxes, man pages and usenet articles are especially such as mailboxes, man pages and usenet articles are especially
@@ -19,15 +25,14 @@ Judges notes:
The program stops when it reaches the end of the template buffer The program stops when it reaches the end of the template buffer
by chance or is killed. by chance or is killed.
To have a chance to compile under a modern CPP, we had to
replace `#D` with `#define`.
Selected notes from the author:
## Selected notes from the author:
This program implements an "Eddington ape" - it generates This program implements an "Eddington ape" - it generates
random text from a supplied template. The template text file random text from a supplied template. The template text file
is read through stdin. The larger the template, the better the is read through stdin. The larger the template, the better the
result. A maximum of 2**12 chars are used. From the template, result. A maximum of `2**12` chars are used. From the template,
the program calculates the statistics of chars that immediately the program calculates the statistics of chars that immediately
follow a given string (correlator string) of a certain length follow a given string (correlator string) of a certain length
(currently 4 - can be varied by changing the definition for P (currently 4 - can be varied by changing the definition for P
+1 -1
View File
@@ -185,7 +185,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry is likely to fail and/or dump core on modern computers." @echo "NOTE: this entry will likely dump core with arm64 chips."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+13 -4
View File
@@ -1,4 +1,4 @@
Most complex algorithm: ## Most complex algorithm:
Paul E. Black Paul E. Black
CIRRUS LOGIC, Inc. CIRRUS LOGIC, Inc.
@@ -7,14 +7,23 @@ Most complex algorithm:
95035 95035
USA USA
Judges notes: ## To build:
make all
NOTE: this entry will likely dump core with arm64 chips. We could get it to work
with modern systems with x86_64 but systems but we at least with macOS arm64
this program dumps core. We could not test Intel Macs.
## Judges' comments:
The original source contained a long line which caused many The original source contained a long line which caused many
mailers to barf. The original file may be re-constructed by mailers to barf. The original file may be re-constructed by
removeing the trailing "\" on line 12 and joining lines 12 and removing the trailing "\" on line 12 and joining lines 12 and
13 together without a space. 13 together without a space.
WHAT FOLLOWS IS A DETAILED PROGRAM EXPLINATION AND SPOILER. WHAT FOLLOWS IS A DETAILED PROGRAM EXPLANATION AND SPOILER.
IF YOU WANT A REAL CHALLENGE, DON'T READ ANY FURTHER AND TRY IF YOU WANT A REAL CHALLENGE, DON'T READ ANY FURTHER AND TRY
TO UNDERSTAND THE PROGRAM VIA THE SOURCE. TO UNDERSTAND THE PROGRAM VIA THE SOURCE.
+8 -1
View File
@@ -121,6 +121,13 @@ OPT= -O3
# #
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
# FORCE use of -include stdlib.h
#
CFLAGS+= -include stdlib.h
## FORCE
# Libraries needed to build # Libraries needed to build
# #
LIBS= LIBS=
@@ -183,7 +190,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry requires a non-standard K&R C compiler to compile." @echo "NOTE: This entry will likely dump core on invalid input."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+14 -3
View File
@@ -1,4 +1,4 @@
Best minimal use of C: ## Best minimal use of C:
Arch D. Robison Arch D. Robison
University of Illinois University of Illinois
@@ -7,7 +7,15 @@ Best minimal use of C:
61801 61801
USA USA
Judges notes: ## To build:
make all
NOTE: we were able to get this to compile under modern systems with a patch from
Yusuke Endoh. Thank you for your assistance Yusuke!
## Judges' comments:
Sites with punch card facilities will be happy to note that Sites with punch card facilities will be happy to note that
the source deck can be re-collated with an ASCII sort. the source deck can be re-collated with an ASCII sort.
@@ -15,7 +23,10 @@ Judges notes:
Note that this program uses only a small subset of the Note that this program uses only a small subset of the
constructs that the C language supports. constructs that the C language supports.
Selected notes from the author: NOTE: this entry will likely dump core with invalid input.
## Selected notes from the author:
This program is a handy picoAPL interpreter written in C--. It This program is a handy picoAPL interpreter written in C--. It
outputs the evaluation of an APL expression from standard outputs the evaluation of an APL expression from standard
+1 -1
View File
@@ -6,7 +6,7 @@
#define Y(_,A)B _(d,e)B d,e;X(A) #define Y(_,A)B _(d,e)B d,e;X(A)
#define Z(P)C P(f,g,h,i)C f,g,h,i;X(P) #define Z(P)C P(f,g,h,i)C f,g,h,i;X(P)
#define c(_)(b=(B)malloc(sizeof(*b)),b->d=_,b->e=d,b) #define c(_)(b=(B)malloc(sizeof(*b)),b->d=_,b->e=d,b)
#define _(D,E,F,G,H)B D();Y(D/**/f,E)Y(D/**/g,F)Y(D/**/h,G)Y(D/**/i,H)Y(D,(*(*d->d)(D/**/f,D/**/g,D/**/h,D/**/i))(d,e)) #define _(D,E,F,G,H)B D();Y(D##f,E)Y(D##g,F)Y(D##h,G)Y(D##i,H)Y(D,(*(*d->d)(D##f,D##g,D##h,D##i))(d,e))
Z(f) Z(f)
Z(g) Z(g)
Z(h) Z(h)
+8 -3
View File
@@ -1,4 +1,4 @@
Best layout: ## Best layout:
Lievaart, Roemer B. Lievaart, Roemer B.
VU-Informatica, Amsterdam VU-Informatica, Amsterdam
@@ -6,12 +6,16 @@ Best layout:
NL 1091 TJ Amsterdam NL 1091 TJ Amsterdam
Netherlands Netherlands
Judges notes: ## To build:
make all
## Judges' comments:
Do you know what this program does? If you do, look again, Do you know what this program does? If you do, look again,
there is more here than meets the PI. there is more here than meets the PI.
Selected notes from the author: ## Selected notes from the author:
Passes lint, but not with the strictest options, for it Passes lint, but not with the strictest options, for it
contains some "null-statements", as well two identifiers contains some "null-statements", as well two identifiers
@@ -22,6 +26,7 @@ Selected notes from the author:
C-beautifier. (First strip newlines and tabs, if your cb can't C-beautifier. (First strip newlines and tabs, if your cb can't
do that.) do that.)
Copyright (c) 1989, Landon Curt Noll & Larry Bassel. Copyright (c) 1989, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is All Rights Reserved. Permission for personal, educational or non-profit use is
granted provided this this copyright and notice are included in its entirety granted provided this this copyright and notice are included in its entirety
+1 -1
View File
@@ -186,7 +186,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry uses non-standard args to main() that do not work with modern compilers." @echo "NOTE: this entry uses a non-standard arg to main() that will not work some modern compilers."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+15 -1
View File
@@ -10,12 +10,26 @@
make all make all
NOTE: This entry might not compile when using modern compilers. NOTE: we used a patch from Yusuke Endoh to get this to compile under gcc. Thank
you Yusuke for your assistance! Cody Boone Ferguson got this to work with clang
by further changing the variable `a` to be not the third argument to `main()` to
a variable declared in `main()`. We thank you for your assistance Cody (he
cynically notes that he did it because tetris just has to work)!
### To run ### To run
./tromp [drops_per_sec [cmd_string]] ./tromp [drops_per_sec [cmd_string]]
NOTE: after this game is finished you will likely get an error along the lines
of:
Segmentation fault: 11
stty: stdin isn't a terminal
and a file `HI` will be in the directory.
## Judges' comments ## Judges' comments
This is a character terminal version of the TETRIS program. This is a character terminal version of the TETRIS program.
+4 -4
View File
@@ -1,13 +1,13 @@
long h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}c,d,l,v[]={(int)t,0,2},w,s,I,K long h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}long c,d,l,v[]={0,0,2},w,s,I,K
=0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1, =0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1,
12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12, 12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12,
1,12,11,-12,-1,1,2,-12,-1,12,13,-12,12,13,14,-11,-1,1,4,-13,-12,12,16,-11,-12, 1,12,11,-12,-1,1,2,-12,-1,12,13,-12,12,13,14,-11,-1,1,4,-13,-12,12,16,-11,-12,
12,17,-13,1,-1,5,-12,12,11,6,-12,12,24};u(){for(i=11;++i<264;)if((k=q[i])-Q[i] 12,17,-13,1,-1,5,-12,12,11,6,-12,12,24};u(){for(i=11;++i<264;)if((k=q[i])-Q[i]
){Q[i]=k;if(i-++I||i%12<1)printf("\033[%d;%dH",(I=i)/12,i%12*2+28);printf( ){Q[i]=k;if(i-++I||i%12<1)printf("\033[%d;%dH",(I=i)/12,i%12*2+28);printf(
"\033[%dm "+(K-k?0:5),k);K=k;}Q[263]=c=getchar();}G(b){for(i=4;i--;)if(q[i?b+ "\033[%dm "+(K-k?0:5),k);K=k;}Q[263]=c=getchar();}G(b){for(i=4;i--;)if(q[i?b+
n[i]:b])return 0;return 1;}g(b){for(i=4;i--;q[i?x+n[i]:x]=b);}main(C,V,a)char* n[i]:b])return 0;return 1;}g(b){for(i=4;i--;q[i?x+n[i]:x]=b);}main(C,V)char**
*V,*a;{h[3]=1000000/(l=C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i< V;{char *a;*v=(long)t;h[3]=1000000/(l=C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i<
25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo stop u");sigvec(14,v, 25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo stop u");sigaction(14,v,
0);t();puts("\033[H\033[J");for(n=f+rand()%7*4;;g(7),u(),g(0)){if(c<0){if(G(x+ 0);t();puts("\033[H\033[J");for(n=f+rand()%7*4;;g(7),u(),g(0)){if(c<0){if(G(x+
12))x+=12;else{g(7);++w;for(j=0;j<252;j=12*(j/12+1))for(;q[++j];)if(j%12==10){ 12))x+=12;else{g(7);++w;for(j=0;j<252;j=12*(j/12+1))for(;q[++j];)if(j%12==10){
for(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G(x=17)||(c for(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G(x=17)||(c
+16 -10
View File
@@ -1,4 +1,4 @@
Best one liner: ## Best one liner:
David Van Brackle David Van Brackle
Department of Computer Science Department of Computer Science
@@ -7,31 +7,37 @@ Best one liner:
32816 32816
USA USA
Judges notes:
## To build:
make all
## Try:
./vanb the rug gary lent
./vanb unix is better than os/2
## Judges' comments:
This program computes all proper subsets of the set of This program computes all proper subsets of the set of
arguments passed to it. Each subset is printed with one arguments passed to it. Each subset is printed with one
element on each line, followed by a line of ten dashes. element on each line, followed by a line of ten dashes.
Try:
vanb the rug gary lent
vanb unix is better than os/2
Selected notes from the author: ## Selected notes from the author:
The program has the following charming and possibly The program has the following charming and possibly
non-portable features: non-portable features:
* It has no local or global variables, * It has no local or global variables, only the command-line parameters.
only the command-line parameters.
* It calls main recursively. * It calls main recursively.
* It alters the command-line parameters. * It alters the command-line parameters.
* It uses the fact that if the high bit is set in a character * It uses the fact that if the high bit is set in a character variable, the
variable, the value is negative. value is negative.
Copyright (c) 1989, Landon Curt Noll & Larry Bassel. Copyright (c) 1989, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is All Rights Reserved. Permission for personal, educational or non-profit use is
+1 -1
View File
@@ -184,7 +184,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: This entry uses non-standard args to main() that do not work with modern compilers." @echo "NOTE: This entry uses non-standard args to main() that do not work with some modern compilers."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+7
View File
@@ -3093,6 +3093,13 @@ a window manager that does not obscure the root window.
<LI><A HREF="1989/tromp/Makefile">Makefile</A> <LI><A HREF="1989/tromp/Makefile">Makefile</A>
<LI><A HREF="1989/tromp/tromp.c">tromp.bsd.c</A> <LI><A HREF="1989/tromp/tromp.c">tromp.bsd.c</A>
<LI><A HREF="1989/tromp/tromp.orig.c">tromp.s5.c</A> <LI><A HREF="1989/tromp/tromp.orig.c">tromp.s5.c</A>
<LI><a href="winners.html#Yusuke_Endoh">Yusuke Endoh</a> provided a patch to get
this to compile with modern compilers.
<a href="winners.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a> fixed this so
it will compile and work under clang ('IOCCC Tetris must work!'). Thank you Yusuke and
Cody!</LI>
</UL>
</UL> </UL>
<A NAME="1989_vanb"></A> <A NAME="1989_vanb"></A>
<P><B>vanb</B> - one-liner prints all subsets of arguments</P> <P><B>vanb</B> - one-liner prints all subsets of arguments</P>