diff --git a/1993/vanb/Makefile b/1993/vanb/Makefile index db4898212..4dae75f2b 100644 --- a/1993/vanb/Makefile +++ b/1993/vanb/Makefile @@ -93,7 +93,7 @@ ARCH= # Defines that are needed to compile # #CDEFINE= -CDEFINE= -DO5=main +CDEFINE= # Include files that are needed to compile # @@ -182,7 +182,6 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: This entry might not compile when using modern compilers." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable diff --git a/1993/vanb/README.md b/1993/vanb/README.md index cb3ff0087..60360df5c 100644 --- a/1993/vanb/README.md +++ b/1993/vanb/README.md @@ -10,21 +10,28 @@ make all -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. +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work with +clang. The problem was that the third arg to main() was not a `char **`. Instead +`O5()` (which was `main()`) is now its own function which main() calls with the +right parameters. Thank you Cody for your assistance! -### To run +## To run: ./vanb 'exp' where: 'exp' an octal expression -## Judges' comments + +## Try: + + ./vanb 1+1 + + ./vanb 4+4 + + +## Judges' comments: The octal expression may contain: diff --git a/1993/vanb/vanb.c b/1993/vanb/vanb.c index 78c46342f..4fccf44a3 100644 --- a/1993/vanb/vanb.c +++ b/1993/vanb/vanb.c @@ -1,5 +1,6 @@ #include -O5(O2,O7,O3)char**O7;{return!(O2+=~01+01)?00:!(O2-=02>01)?printf("\045\157\012" +int O3; +int 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>** O7&&060 <=**O7 ?O5(04 ,O7,012 *O3-060 @@ -25,3 +26,4 @@ O5(O2,O7,O3)char**O7;{return!(O2+=~01+01)?00:!(O2-=02>01)?printf("\045\157\012" ,O7,O5(06,O7, 00)):!( O2+=-02/ 02)?(!(* *O7-053)?O5(011,O7,O3+(++*O7,O5(010,O7,00))):!(055^**O7)?O5(011,O7,O3-(03+*(*O7 )++,O5(0010,O7,00))):O3):!(O2-=0563&0215)?O5(011,O7,O5(010,O7,00)):(++*O7,O3);} +main(O2,O7)char**O7;{return O5(O2,O7,O3);}