Get most 1993 entries to compile
With the exception of lmfjyh which relies on a bug in gcc (that was
fixed in gcc 2.3.3) we have got all 1993 entries to compile under linux.
A couple will not compile under macOS and this is because gcc under
macOS is actually clang despite what many might have you believe (see
below) which is more strict about the second and third arguments of
main().
In a couple entries we used patches from Yusuke Endoh. Thank you Yusuke!
In others we (that is I aka Cody / @xexyl) fixed them (myself). There
was a question to be answered about whether to add #include lines to the
files themselves or add -includes to the Makefile. Since there are
pending changes to the Makefiles which will affect the CFLAGS (and
there's no CINCLUDE variable in these Makefiles yet) we opted for
updating the source files themselves.
One more note about the Makefiles: the 1993/Makefile was modified but I
added an XXX note to it to indicate that it should be fixed once the
other Makefiles are fixed. Specifically it now allows from 1993 one
to run `make' and compile the entries. The comment has what it used to
read and should be but for now is not because of a problem in the other
Makefiles.
As far as gcc under macOS as you can see it is not actually gcc but
clang:
$ /usr/bin/gcc -v 2>&1|head -n 1
Apple clang version 14.0.0 (clang-1400.0.29.202)
If you were to use clang -v under linux you might see something like:
$ clang -v 2>&1|head -n 1
clang version 15.0.7 (Fedora 15.0.7-1.fc37)
and with gcc:
$ gcc --version |head -n 1
gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
If you do by chance have gcc compiled and installed under macOS these
entries will probably work there.
This commit is contained in:
1 parent
a41636a0ed
commit
9875ef3e61
19 files changed
+92
-26
No files matched your search
@@ -0,0 +1,13 @@
|
||||
ant/ant
|
||||
cmills/cmills
|
||||
dgibson/data.name
|
||||
dgibson/data.name2
|
||||
dgibson/life.d
|
||||
ejb/ejb
|
||||
jonth/jonth
|
||||
jonth/jonth.tmp.c
|
||||
leo/leo
|
||||
plummer/plummer
|
||||
rince/rince
|
||||
schnitzi/schnitzi
|
||||
vanb/vanb
|
||||
+6
-1
@@ -66,13 +66,18 @@ YEAR= 1993
|
||||
# build all entries
|
||||
###################
|
||||
#
|
||||
|
||||
# XXX the $(MAKE) $$i is a temporary workaround while we get the entry Makefiles
|
||||
# in order. It should read:
|
||||
#
|
||||
# (cd $$i && $(MAKE) $$i):
|
||||
all:
|
||||
@echo '=-=-= ${YEAR} begin make $@ =-=-='
|
||||
@echo
|
||||
@for i in ${WINNERS} ; do \
|
||||
echo "=-= start ${YEAR}/$$i =-="; \
|
||||
echo "(cd $$i && $(MAKE) $@)"; \
|
||||
(cd $$i && $(MAKE) $@); \
|
||||
(cd $$i && $(MAKE) $$i); \
|
||||
echo "=-= end ${YEAR}/$$i =-="; \
|
||||
echo; \
|
||||
done
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ LN=ln
|
||||
#
|
||||
#CFLAGS=-O -Xa
|
||||
#CFLAGS=-Xa
|
||||
CFLAGS= -ansi
|
||||
CFLAGS= -ansi -include stdlib.h
|
||||
#CFLAGS=
|
||||
|
||||
# ANSI compiler
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
long
|
||||
z[7992],W,H,*t=z,j,k,*T=z,n,b;
|
||||
#include<X11/Xlib.h>
|
||||
#include<stdlib.h>
|
||||
Window*E,D,s,w[999],*e=w;
|
||||
Display*d;
|
||||
Pixmap
|
||||
|
||||
@@ -11,7 +11,7 @@ Best Abuse of the C Preprocessor:
|
||||
|
||||
Judges' comments:
|
||||
|
||||
To use:
|
||||
To build use:
|
||||
sh ./dgibson.sh [datafile]
|
||||
|
||||
where:
|
||||
@@ -35,6 +35,12 @@ Judges' comments:
|
||||
Good luck trying to use a debugger on this entry! Life is not
|
||||
always pretty.
|
||||
|
||||
NOTE: we could not compile this entry under modern macOS but it will work
|
||||
fine under linux. It likely fails to compile under macOS because its gcc is
|
||||
actually just clang which is more strict about the type of the second argument
|
||||
of main(). If you have gcc under macOS it might work just as well. We did not
|
||||
test other systems.
|
||||
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
|
||||
Regular → Executable
+1
-1
@@ -50,4 +50,4 @@ make dgibson
|
||||
# form the next generation
|
||||
#
|
||||
chmod +w life.d
|
||||
dgibson | tee life.d
|
||||
./dgibson | tee life.d
|
||||
+1
-1
@@ -28,7 +28,7 @@ LN=ln
|
||||
#
|
||||
#CFLAGS=-O -Xa
|
||||
#CFLAGS=-Xa
|
||||
CFLAGS= -ansi
|
||||
CFLAGS= -ansi -include stdio.h -include stdlib.h -include string.h
|
||||
#CFLAGS=
|
||||
|
||||
# ANSI compiler
|
||||
|
||||
@@ -19,6 +19,8 @@ Judges' comments:
|
||||
This program's output may be even more obfuscated when played
|
||||
on inverse video. :-)
|
||||
|
||||
Yusuke Endoh provided a patch which allows this entry to compile on modern
|
||||
systems. Thank you Yusuke!
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
|
||||
+5
-3
@@ -1,4 +1,5 @@
|
||||
G int i,j
|
||||
#include <X11/Xlib.h>
|
||||
G long i,j
|
||||
K case
|
||||
R return 0
|
||||
S( x,y) for(x=0; x<y; x++)
|
||||
@@ -35,7 +36,7 @@ Z(){
|
||||
setitimer(0,_,0);
|
||||
}
|
||||
main(){
|
||||
G,*_=(int*)X;
|
||||
G,*_=(long*)X;
|
||||
char*c=
|
||||
"*{{{ {}{{*{{{ {}* { {{*{{{ *{{{ {* {* * { {{ { { *{* { {* *{{{ *{{{ { * { { *{{{ {{ *{{ { {{* { {*{{ {{ {{ {* { {*{{ { *{{{{ *{{ {{ ";
|
||||
for(; *c; )
|
||||
@@ -45,6 +46,7 @@ main(){
|
||||
D=XOpenDisplay(0);
|
||||
L[1]=L[2]=XWhitePixel(D,j=XDefaultScreen(D));
|
||||
XMap@p=XCreate@XRoot@j),0,0,200,470,2,0,1,0,2056,L));
|
||||
XSelectInput(D,p,ExposureMask|KeyPressMask);
|
||||
T W;
|
||||
L[2]=XBlackPixel(D,j);
|
||||
J W;{
|
||||
@@ -85,7 +87,7 @@ Y(){
|
||||
lK(){
|
||||
XNextEvent(D,o);
|
||||
switch(*o){
|
||||
K 2:R+o[2]?0:XX k){
|
||||
K 2:R+o[2]?0:XKeycodeToKeysym(D,((XKeyEvent*)o)->keycode,0);K 12:Y();}R;}d H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,k){
|
||||
G=1;switch(k){
|
||||
K 1:z+l]=1;
|
||||
d(m);R+1;
|
||||
|
||||
+25
-8
@@ -13,10 +13,10 @@ Judges' comments:
|
||||
make leo
|
||||
|
||||
To have the computer guess:
|
||||
leo [colors]
|
||||
./leo [colors]
|
||||
|
||||
To guess the computer's number:
|
||||
mind [colors]
|
||||
./mind [colors]
|
||||
|
||||
where:
|
||||
colors number of possible colors (1 to 15) (default: 6)
|
||||
@@ -28,14 +28,31 @@ Judges' comments:
|
||||
We look forward to more entries from the newer members of the
|
||||
International Internet community.
|
||||
|
||||
On some systems, you may need to remove the line:
|
||||
On more modern systems we had to make the following changes to get it to
|
||||
compile:
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
or replace that line with:
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/malloc.h>
|
||||
--- i/1993/leo/leo.c
|
||||
+++ w/1993/leo/leo.c
|
||||
@@ -1,19 +1,20 @@
|
||||
#include <stdio.h>
|
||||
-#include <malloc.h>
|
||||
+#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <time.h>
|
||||
|
||||
#define A(x) (e^d)&i?e:(e+=i+i/15-d,d<<=4,i<<=4,x)
|
||||
#define B b+=!((e^d)&i)&&(d|=i),i<<=4,
|
||||
#define C i=15,B B B B d=d<<4|d>>12,
|
||||
#define D=(d=g,b=0,C b<<=4, C C C b)
|
||||
#define E if(**y)goto
|
||||
#define F=a[rand()%c]
|
||||
#define G unsigned short
|
||||
#define H e^=a[z],a[z]^=e,e^=a[z],
|
||||
|
||||
-void
|
||||
+int
|
||||
|
||||
|
||||
to successfully build this entry.
|
||||
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#define A(x) (e^d)&i?e:(e+=i+i/15-d,d<<=4,i<<=4,x)
|
||||
#define B b+=!((e^d)&i)&&(d|=i),i<<=4,
|
||||
@@ -11,7 +12,7 @@
|
||||
#define G unsigned short
|
||||
#define H e^=a[z],a[z]^=e,e^=a[z],
|
||||
|
||||
void
|
||||
int
|
||||
main
|
||||
(int
|
||||
z,char
|
||||
|
||||
@@ -16,8 +16,9 @@ Judges' comments:
|
||||
|
||||
There's more than one way to get around disk quotas. :-)
|
||||
|
||||
Some people have reported problems compiling this entry
|
||||
with gcc 2.3.3.
|
||||
This entry will not compile on modern systems because it
|
||||
relies on a compiler bug which was fixed in gcc 2.3.3 (a very
|
||||
long time ago now).
|
||||
|
||||
The make command:
|
||||
|
||||
@@ -27,6 +28,7 @@ Judges' comments:
|
||||
make of lmfjyh.
|
||||
|
||||
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
"Practical and efficient method of compressing source code"
|
||||
|
||||
@@ -28,7 +28,7 @@ LN=ln
|
||||
#
|
||||
#CFLAGS=-O -Xa
|
||||
#CFLAGS=-Xa
|
||||
CFLAGS= -ansi
|
||||
CFLAGS= -ansi -include stdio.h
|
||||
#CFLAGS=
|
||||
|
||||
# ANSI compiler
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ x X l
|
||||
int _tty_ch;
|
||||
bool _echoit;
|
||||
bool _rawmode;
|
||||
SGTTY _tty;
|
||||
int _tty;
|
||||
#define U char
|
||||
#define G for(
|
||||
#define I )malloc(sizeof(
|
||||
@@ -71,7 +71,7 @@ j*a(int Q, int i) {
|
||||
(mvaddch(y,x,X[y][x]),++x^W-1)||(x=0,y++));
|
||||
k=y=- --x;
|
||||
G
|
||||
refresh(),c=select(k,&y,0,0,&v)?getch():0;
|
||||
refresh(),c=select(k,&y,0,0,(v.tv_usec=1<<17,&v))?getch():0;
|
||||
k?++x-W||(x=1,++y-Q||(--k,x=W-1,y=Q-1)):--x||(y--,x=W-1),k|y;
|
||||
)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ LN=ln
|
||||
#
|
||||
#CFLAGS=-O -Xa
|
||||
#CFLAGS=-Xa
|
||||
CFLAGS= -ansi
|
||||
CFLAGS= -ansi -include stdlib.h -include string.h -include ctype.h
|
||||
#CFLAGS=
|
||||
|
||||
# ANSI compiler
|
||||
|
||||
@@ -29,11 +29,18 @@ Judges' comments:
|
||||
Is it true that Elvis is alive?
|
||||
Do colorless green ideas sleep furiously?
|
||||
|
||||
NOTE: The author may also be contacted at: marks@aldrin.ksc.nasa.gov
|
||||
|
||||
We suggest you try using the body (minus the header and signature line)
|
||||
of a Usenet article. You might want to try something from alt.flame. :-)
|
||||
|
||||
If you have a ' in the question this entry may fail.
|
||||
|
||||
NOTE: This entry uses `gets()` so you might get a warning when compiling and
|
||||
running this entry.
|
||||
|
||||
NOTE: this entry will likely segfault if you do not provide it with a data
|
||||
file.
|
||||
|
||||
NOTE: The author may also be contacted at: marks@aldrin.ksc.nasa.gov
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define iii\
|
||||
( I ) if ( ii(I,6\
|
||||
) )I [ strlen(I ) -1]=!1
|
||||
|
||||
@@ -31,6 +31,11 @@ Judges' comments:
|
||||
It is a good thing that this program consists of only one
|
||||
expression, otherwise it might become hard to understand. :-)
|
||||
|
||||
NOTE: we could not compile this entry under modern macOS but it will work
|
||||
fine under linux. It likely fails to compile under macOS because its gcc is
|
||||
actually just clang which is more strict about the type of the third
|
||||
argument of main(). If you have gcc under macOS it might work just as well.
|
||||
We did not test other systems.
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
O5(O2,O7,O3)char**O7;{return!(O2+=~01+01)?00:!(O2-=02>01)?printf("\045\157\012"
|
||||
,O5(012,O7+01,00)):!(O2-=02>>01)?(**O7<=067&&**O7>057?O5(03,O7,*(*O7)++-060+010
|
||||
*O3):O3 ):!(O2 -=-O3- ~O3)? (072>**
|
||||
|
||||
Reference in new issue
Block a user