fix Makefile and README.md for 2012/kang

This commit is contained in:
Landon Curt Noll committed 2023-03-23 22:55:02 -07:00
1 parent b73f7c2469
commit 470a192219
2 files changed
+28 -27

No files matched your search

+6 -7
View File
@@ -64,7 +64,7 @@ X11_INCDIR= /opt/X11/include
# #
#CSILENCE= #CSILENCE=
CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \ 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 # Common C compiler warning flags
# #
@@ -77,7 +77,7 @@ CWARN= -Wall -Wextra ${CSILENCE}
# #
#CSTD= #CSTD=
#CSTD= -ansi #CSTD= -ansi
CSTD= -std=gnu90 CSTD= -std=gnu11
# Compiler bit architecture # Compiler bit architecture
# #
@@ -102,8 +102,8 @@ CINCLUDE=
#CINCLUDE= -include stdlib.h #CINCLUDE= -include stdlib.h
#CINCLUDE= -include stdio.h #CINCLUDE= -include stdio.h
#CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h
#CINCLUDE= -I ${X11_INCDIR} #CINCLUDE= -I ${X11_INCDIR} -I ${X11_INCDIR}/X11
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 #CINCLUDE= `${SDL2_CONFIG} --cflags`
# Optimization # Optimization
# #
@@ -127,7 +127,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
LIBS= LIBS=
#LIBS= -lm #LIBS= -lm
#LIBS= -L ${X11_LIBDIR} -lX11 #LIBS= -L ${X11_LIBDIR} -lX11
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL2 #LIBS= `${SDL2_CONFIG} --libs`
# C compiler to use # C compiler to use
# #
@@ -139,7 +139,7 @@ CC= cc
# #
ifeq ($(CC),clang) ifeq ($(CC),clang)
# #
CSILENCE+= -Wno-long-long -Wno-missing-variable-declarations -Wno-pedantic \ CSILENCE+= -Wno-missing-variable-declarations -Wno-pedantic \
-Wno-poison-system-directories -Wno-poison-system-directories
# #
CWARN+= -Weverything CWARN+= -Weverything
@@ -325,4 +325,3 @@ pluto: charon
@echo "dwarf is a type of planet" @echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet" @echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+22 -20
View File
@@ -1,27 +1,31 @@
# Best short program # Best short program
Seonghoon Kang Seonghoon Kang
<kang.seonghoon@mearie.org> <kang.seonghoon@mearie.org>
## To build: # To build:
make all ```sh
make
### To run ```
### To run: ### 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: ### Try:
echo Nineteen hundred and eighty-four | ./kang ```sh
echo uno | ./kang echo Nineteen hundred and eighty-four | ./kang
echo trois | ./kang echo uno | ./kang
echo fier | ./kang echo trois | ./kang
echo "shest'" | ./kang echo fier | ./kang
echo "shest'" | ./kang
```
### Selected Judges Remarks: ## Judges' comments:
The judges were able to appreciate the Indo-European language family The judges were able to appreciate the Indo-European language family
relation by making this entry successfully recognize *some* French, 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: ## Author's comments:
## Synopsis ### Synopsis
This short program reads a spelt number (e.g. `forty-two`) and writes a 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, 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. * A bare `hundred`, `thousand` etc. do not work.
* `one million million` does not work. Get used to `one trillion`! * `one million million` does not work. Get used to `one trillion`!
## Requirements ### Requirements
This program is quite portable, only requiring the following: 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`, (it has to be negative per the standard) and both signed and unsigned `char`,
for example. Furthermore it is endian-independent. for example. Furthermore it is endian-independent.
## Obfuscations (SPOILERS!) ### Obfuscations (SPOILERS!)
Many obfuscations used are typical for standard IOCCC entries: 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, follow. The order of lookup table, for example, is very important,
and the biggest constant 6177 is not arbitrarily chosen. and the biggest constant 6177 is not arbitrarily chosen.
## Acknowledgement ### Acknowledgement
The cleaner (size-optimized) version of this program was originally published 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 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 aware of possible improvements. I'd also like to thank Seo Sanghyeon for
proof-reading remarks. proof-reading remarks.
## Copyright:
--------------------------------------------------------------------------------
<!--
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved (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]. This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html [judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/ [cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->