diff --git a/2012/kang/Makefile b/2012/kang/Makefile index 1897157ae..2e87a8db4 100644 --- a/2012/kang/Makefile +++ b/2012/kang/Makefile @@ -64,7 +64,7 @@ X11_INCDIR= /opt/X11/include # #CSILENCE= CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ - -Wno-int-conversion -Wno-pointer-to-int-cast + -Wno-implicit-int -Wno-int-conversion -Wno-pointer-to-int-cast # Common C compiler warning flags # @@ -77,7 +77,7 @@ CWARN= -Wall -Wextra ${CSILENCE} # #CSTD= #CSTD= -ansi -CSTD= -std=gnu90 +CSTD= -std=gnu11 # Compiler bit architecture # @@ -102,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 # @@ -127,7 +127,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 # @@ -139,7 +139,7 @@ CC= cc # ifeq ($(CC),clang) # -CSILENCE+= -Wno-long-long -Wno-missing-variable-declarations -Wno-pedantic \ +CSILENCE+= -Wno-missing-variable-declarations -Wno-pedantic \ -Wno-poison-system-directories # CWARN+= -Weverything @@ -325,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/2012/kang/README.md b/2012/kang/README.md index 8303b79f2..7bf0ce86d 100644 --- a/2012/kang/README.md +++ b/2012/kang/README.md @@ -1,27 +1,31 @@ # Best short program -Seonghoon Kang - + Seonghoon Kang + -## To build: +# To build: - make all - -### To run +```sh +make +``` ### To run: - echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang +```sh +echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang +``` ### Try: - echo Nineteen hundred and eighty-four | ./kang - echo uno | ./kang - echo trois | ./kang - echo fier | ./kang - echo "shest'" | ./kang +```sh +echo Nineteen hundred and eighty-four | ./kang +echo uno | ./kang +echo trois | ./kang +echo fier | ./kang +echo "shest'" | ./kang +``` -### Selected Judges Remarks: +## Judges' comments: The judges were able to appreciate the Indo-European language family relation by making this entry successfully recognize *some* French, @@ -34,7 +38,7 @@ We've added a linefeed to the print format for convenience. ## Author's comments: -## Synopsis +### Synopsis This short program reads a spelt number (e.g. `forty-two`) and writes a corresponding decimal number (e.g. `42`). Too long for one-liners, alas, @@ -59,7 +63,7 @@ It does *not* accept some spelt numbers, which I found mostly irrelevant: * A bare `hundred`, `thousand` etc. do not work. * `one million million` does not work. Get used to `one trillion`! -## Requirements +### Requirements This program is quite portable, only requiring the following: @@ -78,7 +82,7 @@ The design of the program explicitly allows for `EOF` which does not equal to -1 (it has to be negative per the standard) and both signed and unsigned `char`, for example. Furthermore it is endian-independent. -## Obfuscations (SPOILERS!) +### Obfuscations (SPOILERS!) Many obfuscations used are typical for standard IOCCC entries: @@ -142,19 +146,17 @@ Having said this important trick, other details should be relatively easier to follow. The order of lookup table, for example, is very important, and the biggest constant 6177 is not arbitrarily chosen. -## Acknowledgement +### Acknowledgement The cleaner (size-optimized) version of this program was originally published in my website in July 2011. Sun Park and others have reviewed it and let me aware of possible improvements. I'd also like to thank Seo Sanghyeon for proof-reading remarks. +## Copyright: --------------------------------------------------------------------------------- -