diff --git a/1985/sicherman/.gitignore b/1985/sicherman/.gitignore index 82b0ebb1e..7cf6dfe81 100644 --- a/1985/sicherman/.gitignore +++ b/1985/sicherman/.gitignore @@ -1 +1,2 @@ sicherman +sicherman.alt diff --git a/1985/sicherman/Makefile b/1985/sicherman/Makefile index 1e841f9c1..3ff5c547d 100644 --- a/1985/sicherman/Makefile +++ b/1985/sicherman/Makefile @@ -61,7 +61,7 @@ CDEFINE= # Include files that are needed to compile # -CINCLUDE= +CINCLUDE= -include unistd.h # Optimization # @@ -111,12 +111,9 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= -ALT_TARGET= +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt -# FORCE use of -traditional-cpp -# -CFLAGS+= -traditional-cpp ################# # build the entry @@ -130,13 +127,12 @@ all: data ${TARGET} supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - @echo "NOTE: NOTE: this entry requires a compiler that supports -traditional-cpp." ${CC} ${CFLAGS} $< -o $@ ${LIBS} # alternative executable # -alt: data ${ALT_TARGET} - @${TRUE} +alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -traditional-cpp $< -o $@ ${LIBS} # data files # diff --git a/1985/sicherman/README.md b/1985/sicherman/README.md index d460128ff..5cd71a3a8 100644 --- a/1985/sicherman/README.md +++ b/1985/sicherman/README.md @@ -4,13 +4,35 @@ Col. G. L. Sicherman ## To build: - make all +```sh +make all +``` -NOTE: This entry requires a compiler that support `-traditional-cpp`. + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this very twisted +entry to not require `-traditional-cpp`. He'd like to refer you to the original +file in [sicherman.alt.c](sicherman.alt.c) and he suggests that you then compare +it to [sicherman.c](sicherman.c) for some good old C-fashioned fun! Thank you +Cody for your assistance! ## Try: - ./sicherman < sicherman.c +```sh +./sicherman < sicherman.c + +echo IOCCC | ./sicherman +``` + +### Alternate code: + +If you do have a compiler that supports `-traditional-cpp` you may compile the +original like: + +```sh +make alt +``` + +Use `sicherman.alt` as you would `sicherman`. ## Judges' comments: diff --git a/1985/sicherman/sicherman.alt.c b/1985/sicherman/sicherman.alt.c new file mode 100644 index 000000000..5070cc8de --- /dev/null +++ b/1985/sicherman/sicherman.alt.c @@ -0,0 +1,23 @@ +#define C_C_(_)~' '&_ +#define _C_C(_)('\b'b'\b'>=C_C>'\t'b'\n') +#define C_C _|_ +#define b * +#define C /b/ +#define V _C_C( +main(C,V) +char **V; +/* C program. (If you don't + * understand it look it + */ up.) (In the C Manual) +{ + char _,__; + while (read(0,&__,1) & write((_=(_=C_C_(__),C)), + _C_,1)) _=C-V+subr(&V); +} +subr(C) +char *C; +{ + C="Lint says "argument Manual isn't used." What's that + mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ + '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); +} diff --git a/1985/sicherman/sicherman.c b/1985/sicherman/sicherman.c index 5070cc8de..ee4afc85e 100644 --- a/1985/sicherman/sicherman.c +++ b/1985/sicherman/sicherman.c @@ -1,23 +1,11 @@ -#define C_C_(_)~' '&_ -#define _C_C(_)('\b'b'\b'>=C_C>'\t'b'\n') -#define C_C _|_ -#define b * -#define C /b/ -#define V _C_C( -main(C,V) -char **V; -/* C program. (If you don't - * understand it look it - */ up.) (In the C Manual) +main(/*/,('\b'*'\b'>=_|_>'\t'*'\n') +char **('\b'*'\b'>=_|_>'\t'*'\n') (in the /*/ manual) { char _,__; - while (read(0,&__,1) & write((_=(_=C_C_(__),C)), - _C_,1)) _=C-V+subr(&V); -} -subr(C) -char *C; -{ - C="Lint says "argument Manual isn't used." What's that - mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+ - '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1)); + while (read(0,&__,1) & write((_=(_=~' '&__,/*/)), + _C_,1)) _=/*/-('\b'*'\b'>=_|_>'\t'*'\n'))?__:__-_+ + + + '\b'*'\b'|((_-52)%('\b'*'\b'+~' '&'\t'*'\n')+1),1),&_,1)); } + diff --git a/bugs.md b/bugs.md index e8ac9a21c..90e12ecc6 100644 --- a/bugs.md +++ b/bugs.md @@ -247,19 +247,6 @@ continues to run. We have not had a chance to try and fix this yet. -## [1985/sicherman](1985/sicherman/sicherman.c) ([README.md](1985/sicherman/README.md)) -## STATUS: Requires a compiler supporting `-traditional-cpp` - alternate code requested - -This entry needs a compiler that support `-traditional-cpp`. `gcc` -supports this but `clang` does not. Please be advised that `gcc` under macOS is -actually gcc if it looks like it's gcc (two different binaries). - -If you do wish to provide an alternate version of the program that does not need -compiler supporting we welcome you to summit such code via a -[GitHub pull request](https://github.com/ioccc-src/temp-test-ioccc/pulls) and we -will be happy to credit you in the entry's _README.md_ file. - - # 1986