diff --git a/2018/anderson/.gitignore b/2018/anderson/.gitignore index ea1749132..ffb16e793 100644 --- a/2018/anderson/.gitignore +++ b/2018/anderson/.gitignore @@ -1 +1,2 @@ prog +prog.alt diff --git a/2018/anderson/Makefile b/2018/anderson/Makefile index abf722999..5840bc4a3 100644 --- a/2018/anderson/Makefile +++ b/2018/anderson/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/env make # -# IOCCC 2018 winning entry - bellard +# IOCCC 2018 winning entry - anderson ################################################################################ # @@ -63,7 +63,7 @@ X11_INCDIR= /opt/X11/include # Common C compiler warnings to silence # #CSILENCE= -CSILENCE= -Wno-c99-extensions -Wno-gcc-compat -Wno-vla-extension +CSILENCE= -Wno-unsequenced # Common C compiler warning flags # @@ -101,8 +101,8 @@ CINCLUDE= #CINCLUDE= -include stdlib.h #CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 +#CINCLUDE= -I ${X11_INCDIR} -I ${X11_INCDIR}/X11 +#CINCLUDE= `${SDL2_CONFIG} --cflags` # Optimization # @@ -126,7 +126,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} LIBS= #LIBS= -lm #LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#LIBS= `${SDL2_CONFIG} --libs` # C compiler to use # @@ -160,10 +160,11 @@ endif # Special flags for this entry ############################## # -ENTRY= bellard +ENTRY= anderson PROG= prog # OBJ= ${PROG}.o +CSRC= ${PROG}.o DATA= TARGET= ${PROG} # @@ -185,14 +186,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} @@ -327,4 +328,3 @@ pluto: charon @echo "dwarf is a type of planet" @echo "therefore, $@ is a planet" @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" - diff --git a/2018/anderson/README.md b/2018/anderson/README.md index 72e9a0a5e..3b624167b 100644 --- a/2018/anderson/README.md +++ b/2018/anderson/README.md @@ -1,50 +1,61 @@ # Most able to divine code gaps -Derek Anderson + Derek Anderson +` +# To build: -## To build: +```sh +make +``` - make all +### To run: -### To run - - ./prog < textfile +```sh +./prog < textfile +``` ### Try: - ./prog < prog.c - ./prog < prog.alt.c - ./prog < README.md +```sh +./prog < prog.c +./prog < prog.alt.c +./prog < README.md +``` -### Alternate code +### Alternate code: -An alternate version of this entry, prog.alt.c, is provided. -Compare `prog.c` and `prog.alt.c` and find out why we had to modify the entry, and what confused the author -(see the author's remarks). No, it was not the shape of the Roman V that we, or the compiler, didn't like. +An alternate version of this entry, `prog.alt.c`, is provided. -### Alternate code +Compare `prog.c` and `prog.alt.c` and find out why we had to modify +the entry, and what confused the author (see the author's remarks). +No, it was not the shape of the Roman V that we, or the compiler, +didn't like. To compile this alternate version: - make alt +```sh +make alt +``` Use `prog.alt` as you would `prog` above. -### Selected Judges Remarks: +## Judges' comments: With this entry, you won't need to turn your monitor [upside down](http://en.wikipedia.org/wiki/River_%28typography%29)! ## Author's comments: -## Compiling the program +### Compiling the program - gcc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog +```sh +cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog +``` Also works with a standard of c99, but c90/c89 will not compile due to for loop initial declarations, along with additional warnings about variable length arrays and lack of a return statement. -## Additional info +### Additional info This small program, when given text on stdin, will produce a pattern of squiggly lines. This pattern is deterministic, and it shouldn't be too @@ -75,11 +86,10 @@ variable assignment, such as `j=k`. There is some filler fluff, such as added for the purpose of making certain things line up right, and only secondarily to obfuscate. --------------------------------------------------------------------------------- -