fix Makefile and README.md for 2012/kang
This commit is contained in:
1 parent
b73f7c2469
commit
470a192219
2 files changed
+28
-27
No files matched your search
+6
-7
@@ -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"
|
||||
|
||||
+22
-20
@@ -1,27 +1,31 @@
|
||||
# Best short program
|
||||
|
||||
Seonghoon Kang
|
||||
<kang.seonghoon@mearie.org>
|
||||
Seonghoon Kang
|
||||
<kang.seonghoon@mearie.org>
|
||||
|
||||
## 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:
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
<!--
|
||||
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
Reference in new issue
Block a user