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
+353 -280

No files matched your search

-2
View File
@@ -182,7 +182,6 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c
@echo "NOTE: This entry is likely to fail and/or dump core on modern computers."
${RM} -f $@
${CP} -f fubar.sh $@
${CHMOD} +x $@
@@ -198,7 +197,6 @@ data: ${DATA}
@${TRUE}
${PROG}.orig: ${PROG}.orig.c
@echo "NOTE: This entry is likely to fail and/or dump core on modern computers."
${RM} -f $@
${CP} -f fubar.orig.sh $@
${CHMOD} +x $@
+6 -3
View File
@@ -17,10 +17,13 @@
## Judges' comments
Run this with a single digit argument (or wait a long time).
Run this with a single digit argument (or wait a long time).
The blank line at the beginning of the source is mandatory.
Do you know why?
The blank line at the beginning of the source is mandatory.
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
+6 -5
View File
@@ -1,19 +1,20 @@
#include <stdio.h>
#include <stdlib.h>
#define QQ 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 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);}
cc ouroboros.c -o x
#define zxc ;{/*
cat ouroboros.c | x $1 > x1
cat ./ouroboros.c | ./x $1 > x1
if [ $? -ne 0 ]; then
exit
fi
mv x1 ouroboros.c
chmod +x ouroboros.c
exec ouroboros.c $1
mv x1 ./ouroboros.c
chmod +x ./ouroboros.c
exec ./ouroboros.c $1
exit
*/
+2 -2
View File
@@ -11,9 +11,9 @@ fi
rm -f ouroboros.c x1 x
ex - <<EOF
r fubar.c
7,8j
8,9j
w ouroboros.c
EOF
chmod +x ouroboros.c
./ouroboros.c $1
rm -f ouroboros.c x1 x
#rm -f ouroboros.c x1 x