diff --git a/2012/konno/.gitignore b/2012/konno/.gitignore index 6581a3188..c475a0544 100644 --- a/2012/konno/.gitignore +++ b/2012/konno/.gitignore @@ -1,2 +1,2 @@ konno -konno_deobfuscate +konno.alt diff --git a/2012/konno/Makefile b/2012/konno/Makefile index 107f1c18b..1940b64b7 100644 --- a/2012/konno/Makefile +++ b/2012/konno/Makefile @@ -104,8 +104,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 # @@ -129,7 +129,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} LIBS= #LIBS= -lm #LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL2 +#LIBS= `${SDL2_CONFIG} --libs` # C compiler to use # @@ -170,8 +170,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= ${PROG}_deobfuscate.o -ALT_TARGET= ${PROG}_deobfuscate +ALT_OBJ= ${PROG}.alt.o +ALT_TARGET= ${PROG}.alt ################# @@ -188,14 +188,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}_deobfuscate: ${PROG}_deobfuscate.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} @@ -330,4 +330,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/2012/konno/README.md b/2012/konno/README.md index 98ba48a1f..9e5b10309 100644 --- a/2012/konno/README.md +++ b/2012/konno/README.md @@ -1,33 +1,43 @@ # Best one liner -Taketo Konno -Tokyo, Japan - + Taketo Konno + Tokyo, Japan + -## To build: +# To build: - make all +```sh +make +``` ### To run: - ./konno N - # where N is 0 to 255 +```sh +./konno N +``` + +NOTE: N is an integer from 0 to 255. ### Try: - ./konno 30 +```sh +./konno 30 +``` ### Alternate code -An alternate version of this entry, konno_deobfuscate.c, is provided. This alternate code is an unobfuscated version of the winning code. +An alternate version of this entry, `konno_alt.c`, is provided. +This alternate code is an unobfuscated version of the winning code. To compile this alternate version: - make alt +```sh +make alt +``` -Use `konno_deobfuscate` as you would `konno` above. +Use `konno.alt` as you would `konno` above. -### Selected Judges Remarks: +## Judges' comments: This entry is a good one-liner to analyze completely. @@ -42,11 +52,13 @@ This program outputs [elementary cellular automaton](http://mathworld.wolfram.co Try: - ./konno 30 - ./konno 90 - ./konno 102 - ./konno 109 - ./konno 165 +```sh +./konno 30 +./konno 90 +./konno 102 +./konno 109 +./konno 165 +``` There are 256 (from 0 to 255) possible rules. @@ -54,11 +66,15 @@ There are 256 (from 0 to 255) possible rules. This program uses bit operations. I think - 7&O<>!o+29 +```c +7&O<>!o+29 +``` is an intersting operation. This isn't equal to - 7&O>>29 +```c +7&O>>29 +``` operation. What is the operation doing? @@ -66,11 +82,10 @@ operation. What is the operation doing? This program assumes that the size of int is 4. --------------------------------------------------------------------------------- - diff --git a/2012/konno/konno_deobfuscate.c b/2012/konno/konno.alt.c similarity index 100% rename from 2012/konno/konno_deobfuscate.c rename to 2012/konno/konno.alt.c