diff --git a/2015/endoh4/Makefile b/2015/endoh4/Makefile index 67b708fd5..b916651f9 100644 --- a/2015/endoh4/Makefile +++ b/2015/endoh4/Makefile @@ -63,20 +63,21 @@ X11_INCDIR= /opt/X11/include # Common C compiler warnings to silence # #CSILENCE= -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-main -Wno-return-type +CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-implicit-int \ + -Wno-main -Wno-pedantic -Wno-return-type # Common C compiler warning flags # #CWARN= ${CSILENCE} #CWARN= -Wall ${CSILENCE} -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} +#CWARN= -Wall -Wextra ${CSILENCE} +CWARN= -Wall -Wextra -pedantic ${CSILENCE} # Compiler standard # #CSTD= #CSTD= -ansi -CSTD= -std=gnu90 +CSTD= -std=gnu11 # Compiler bit architecture # @@ -101,8 +102,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 +127,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 # @@ -138,8 +139,8 @@ CC= cc # ifeq ($(CC),clang) # -CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-pedantic \ - -Wno-poison-system-directories -Wno-strict-prototypes +CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-poison-system-directories \ + -Wno-strict-prototypes # CWARN+= -Weverything # @@ -167,8 +168,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}.alt.o -ALT_TARGET= ${PROG}.alt +ALT_OBJ= +ALT_TARGET= ################# @@ -185,9 +186,6 @@ 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} @@ -327,4 +325,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/2015/endoh4/README.md b/2015/endoh4/README.md index 2322d9c68..321b74aab 100644 --- a/2015/endoh4/README.md +++ b/2015/endoh4/README.md @@ -1,38 +1,47 @@ # Best One-liner -Yusuke Endoh - -Twitter: @mametter + Yusuke Endoh + + Twitter: @mametter -## To build: +# To build: - make all +```sh +make +``` -### To run +### To run: - ./prog +```sh +./prog +``` ### Try: - ./prog @ @ @ @ @ @ +```sh +./prog @ @ @ @ @ @ - ./prog @ @ @ @ @ @ @ @ @ @ @ @ +./prog @ @ @ @ @ @ @ @ @ @ @ @ - ./prog $(perl -e 'print "@ " x (2*3*5*7);') +./prog $(perl -e 'print "@ " x (2*3*5*7);') - ./prog $(< Makefile) +./prog $(< Makefile) +``` ### Alternate code -An alternate version of this entry, prog.alt.c, is provided. This alternate code does not contain improvements suggested by Gil Dogon. +An alternate version of this entry, `prog.alt.c`, is provided. +This alternate code does not contain improvements suggested by Gil Dogon. To compile this alternate version: - make alt +```sh +make alt +``` Use `prog.alt` as you would `prog` above. -### Selected Judges Remarks: +## Judges' comments: For this one liner it is best to avoid prime numbers. The output groups factors in the x-y dimensions. How many factors can be represented before you @@ -56,11 +65,10 @@ Inspired by [Animated Factorization Diagrams](http://www.datapointed.net/visuali EDIT: `prog.alt.c` is the original version that I submitted. Gil Dogon kindly improved it during the review. Thank you! --------------------------------------------------------------------------------- -