diff --git a/2012/kang/.entry.json b/2012/kang/.entry.json index 765fe0b55..88f5c9db8 100644 --- a/2012/kang/.entry.json +++ b/2012/kang/.entry.json @@ -29,14 +29,6 @@ "display_via_github" : true, "entry_text" : "entry Makefile" }, - { - "file_path" : "kang.alt.c", - "inventory_order" : 40, - "OK_to_edit" : true, - "display_as" : "c", - "display_via_github" : true, - "entry_text" : "alternate source code" - }, { "file_path" : "kang.orig.c", "inventory_order" : 50, @@ -45,14 +37,6 @@ "display_via_github" : true, "entry_text" : "original source code" }, - { - "file_path" : "de.alt.sh", - "inventory_order" : 100, - "OK_to_edit" : true, - "display_as" : "shellscript", - "display_via_github" : true, - "entry_text" : "German words script for 1 through 13 for alternate code" - }, { "file_path" : "de.sh", "inventory_order" : 100, @@ -61,14 +45,6 @@ "display_via_github" : true, "entry_text" : "German words script for 1 through 13" }, - { - "file_path" : "en.alt.sh", - "inventory_order" : 100, - "OK_to_edit" : true, - "display_as" : "shellscript", - "display_via_github" : true, - "entry_text" : "English words script for 1 through 13 for alternate code" - }, { "file_path" : "en.sh", "inventory_order" : 100, diff --git a/2012/kang/README.md b/2012/kang/README.md index dc54639bb..3e800f8c1 100644 --- a/2012/kang/README.md +++ b/2012/kang/README.md @@ -4,9 +4,6 @@ make ``` -There is alternate code which fixes some German at the expense of other German. -See [Alternate code](#alternate-code) below for the (fun) rationale here. - ## To use: @@ -29,52 +26,6 @@ How does it have no `u` or `o` in a string in the source code and yet it gets `uno` right? -## Alternate code: - -This alternate code fixes the program that would throw off those who know German -where the sound of 'V' is 'F' and so the program had the letter be 'F'. A -problem, however, with changing it is that it breaks other words including in -German. Thus there is the alternate version instead which fixes a problem for -Germans that causes problems for Germans so if you're German you'll just have to -deal with it :-) It also breaks other words too and this happens only for one -letter change. With this one should hopefully be able to really appreciate the -subtlety of this entry even more. - - -### Alternate build: - -``` - make alt -``` - - -### Alternate use: - -``` - echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang.alt - - echo vier | ./kang.alt - - echo uno | ./kang.alt -``` - - -### Alternate try: - -``` - ./try.alt.sh # try various languages - - ./en.alt.sh # English 0 through 13 - - ./de.alt.sh # German 0 through 13 with both umlauts and without (additional 'e') -``` - -What does it get right? What does it get wrong? How does it compare to the -original entry without the change of `f` to `v`? - -Finally why does it get wrong what it gets wrong? - - ## Judges' remarks: The judges were able to appreciate the Indo-European language family @@ -100,6 +51,10 @@ correctly reports 500 but: does not report 100, instead printing 0? +Also, can you get the program to use the proper `V` in German instead of `F`, +for `vier` (four)? In other words, can you get it to use `vier` instead of +`fier`? What happens if you do do this? + ## Author's remarks: diff --git a/2012/kang/de.alt.sh b/2012/kang/de.alt.sh deleted file mode 100755 index b6fa1ed95..000000000 --- a/2012/kang/de.alt.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -# -# run 2012/kang with German words for 0 through 13 -# -# For five, fünf, it uses both ue and umlaut (ü) form, and for twelve, zwölf, it -# uses both oe and ö. -# -# What does it get right and what does it get wrong? Why does it get what it -# gets wrong wrong? - -# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it -# this way allows us to have the user specify a different compiler in an easy -# way. -if [[ -z "$CC" ]]; then - CC="cc" -fi - -make CC="$CC" everything >/dev/null || exit 1 - -# clear screen after compilation so that only the entry is shown -clear - -# set up path to program if not set -if [[ -z "$KANG" ]]; then - KANG="kang.alt" -fi - -# first set up translation (for those who don't know German): -declare -a NUMBERS -j=0 -for i in 0 1 2 3 4 5 5 6 7 8 9 10 11 12 12 13; do - NUMBERS["$j"]="$i"; - ((j++)) -done - - -j=0 -for i in Null eins zwei drei vier fünf fuenf sechs sieben acht neun zehn elf zwoelf zwölf dreizehn ; \ -do - read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: " - echo 1>&2 - echo "$i" | "./$KANG" - ((j++)) -done diff --git a/2012/kang/de.sh b/2012/kang/de.sh index f31a3e9f8..c54376ea4 100755 --- a/2012/kang/de.sh +++ b/2012/kang/de.sh @@ -15,7 +15,7 @@ if [[ -z "$CC" ]]; then CC="cc" fi -make CC="$CC" everything >/dev/null || exit 1 +make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear diff --git a/2012/kang/en.alt.sh b/2012/kang/en.alt.sh deleted file mode 100755 index 64aee361c..000000000 --- a/2012/kang/en.alt.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# -# run 2012/kang with English words for 1 through 13 -# -# What does it get right and what does it get wrong? Why does it get what it -# gets wrong wrong? - -# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it -# this way allows us to have the user specify a different compiler in an easy -# way. -if [[ -z "$CC" ]]; then - CC="cc" -fi - -make CC="$CC" everything >/dev/null || exit 1 - -# clear screen after compilation so that only the entry is shown -clear - -# set up path to program if not set -if [[ -z "$KANG" ]]; then - KANG="kang.alt" -fi - -declare -a NUMBERS -j=0 -for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13; do - NUMBERS["$j"]="$i"; - ((j++)) -done - -j=0 -for i in zero one two three four five six seven eight nine ten eleven twelve thirteen ; \ -do - read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: " - echo 1>&2 - echo "$i" | "./$KANG" - ((j++)) -done diff --git a/2012/kang/en.sh b/2012/kang/en.sh index dfa3c5dff..59719c8d4 100755 --- a/2012/kang/en.sh +++ b/2012/kang/en.sh @@ -13,7 +13,7 @@ if [[ -z "$CC" ]]; then CC="cc" fi -make CC="$CC" everything >/dev/null || exit 1 +make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear diff --git a/2012/kang/kang.alt.c b/2012/kang/kang.alt.c deleted file mode 100644 index 53655c26a..000000000 --- a/2012/kang/kang.alt.c +++ /dev/null @@ -1,5 +0,0 @@ -long long n,u,m,b;main(e,r)char **r;{f\ -or(;n++||(e=getchar()|32)>=0;b="ynwtsvlrabg"[n%=11]-e?b:b*8+ -n)for(r=b%64-25;e<47&&b;b/=8)for(n=19;n;n["1+DIY/.K430x9\ -G(kC["]-42&255^b||(m+=n>15?n:n>9?m%u*~-u:~(int)r?n+ -!(int)r*16:n*16,b=0))u=1ll<<6177%n--*4;printf("%llx\n",m);} diff --git a/2012/kang/try.alt.sh b/2012/kang/try.alt.sh deleted file mode 100755 index 4940f0504..000000000 --- a/2012/kang/try.alt.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -# -# try.alt.sh - demonstrate IOCCC entry 2012/kang alternate code - -# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it -# this way allows us to have the user specify a different compiler in an easy -# way. -if [[ -z "$CC" ]]; then - CC="cc" -fi - -make CC="$CC" everything >/dev/null || exit 1 - -# clear screen after compilation so that only the entry is shown -clear - -read -r -n 1 -p "Press any key to run: echo Nineteen hundred and eighty-four | ./kang.alt # 1984: " -echo 1>&2 -echo Nineteen hundred and eighty-four | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo uno | ./kang.alt # 1: " -echo 1>&2 -echo uno | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo trois | ./kang.alt # 3: " -echo 1>&2 -echo trois | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo fier | ./kang.alt # 4, should be vier: " -echo 1>&2 -echo fier | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo vier | ./kang.alt # 4: " -echo 1>&2 -echo vier | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo \"shest'\" | ./kang.alt # 6: " -echo 1>&2 -echo "shest'" | ./kang.alt -echo 1>&2 - -read -r -n 1 -p "Press any key to run: echo dos | ./kang.alt # 2: " -echo 1>&2 -echo dos | ./kang.alt -echo 1>&2 diff --git a/2012/kang/try.sh b/2012/kang/try.sh index a8f3fb5d5..5857e2d75 100755 --- a/2012/kang/try.sh +++ b/2012/kang/try.sh @@ -9,7 +9,7 @@ if [[ -z "$CC" ]]; then CC="cc" fi -make CC="$CC" everything >/dev/null || exit 1 +make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear @@ -31,15 +31,12 @@ echo 1>&2 read -r -n 1 -p "Press any key to run: echo fier | ./kang # 4, should be vier: " echo 1>&2 -echo fier | ./kang # notice the issue here, see alternate code instead +echo fier | ./kang # notice the issue here; this is intentional echo 1>&2 read -r -n 1 -p "Press any key to run: echo vier | ./kang # 4: " echo 1>&2 -echo vier | ./kang # notice the issue here, see alternate code instead -echo 1>&2 -echo "Note: for a version that gets this one right (breaking others" 1>&2 -echo "including fier), see the alternate code." 1>&2 +echo vier | ./kang # notice the issue he; this is intentional echo 1>&2 read -r -n 1 -p "Press any key to run: echo \"shest'\" | ./kang # 6: " @@ -51,3 +48,8 @@ read -r -n 1 -p "Press any key to run: echo dos | ./kang # 2: " echo 1>&2 echo dos | ./kang echo 1>&2 + +read -r -n 1 -p "Press any key to run: echo forty-two | ./kang # 42: " +echo 1>&2 +echo forty-two | ./kang +echo 1>&2 diff --git a/thanks-for-help.html b/thanks-for-help.html index d410d8feb..790ecd18b 100644 --- a/thanks-for-help.html +++ b/thanks-for-help.html @@ -3741,30 +3741,12 @@ title and stylesheet) and other formatting changes.

Winning entry: 2012/kang

Winning entry source code: kang.c

-

Cody added alternate code that fixes a problem where in German ‘v’ -sounds like ‘f’ which the program has as ‘f’: with the original version it would -translate ‘fier’ to ‘4’ when the word is ‘vier’. This was during a time that a -lot of entries that no longer worked were fixed and it was done without much -thought but having this alternate version allows one to appreciate the entry -even more so it was kept in.

-

This change will actually break other translations. It also was a feature, not a -bug, even if it might seem like a bug. But having both versions allows one to -appreciate the entry even more, given how simple the difference is: as has been -seen in many entries over the years, a single character can drastically change -what happens, sometimes in surprising and delightful ways!

-

Cody also added six scripts, starting with -en.sh, de.sh, -en.alt.sh and -de.alt.sh which count from 0 through 13 in -English and German using the original entry and the alt version respectively.

-

In the German scripts it uses the umlaut and also does it without the umlaut -(add an ‘e’). Notice how the program picks up on this! All scripts can use -either version but the .alt.sh versions default to the alt version whereas -the other defaults to the submitted entry. See the index.html for details.

-

The fifth and sixth scripts, try.sh and -try.alt.sh, run a sequence of commands to -show different languages and numbers with the submitted and alternate version -respectively. Notice how a single letter changes so much!

+

Cody added the scripts +en.sh, de.sh and +try.sh.

+

In the German script it uses the umlaut for five (fünf) and also does it +without the umlaut (add an ‘e’ i.e. fuenf). Notice how the program picks up on +this!

Winning entry: 2012/konno

Winning entry source code: konno.c

diff --git a/thanks-for-help.md b/thanks-for-help.md index 664ce2eff..422d328d4 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4749,34 +4749,13 @@ title and stylesheet) and other formatting changes. ### Winning entry source code: [kang.c](%%REPO_URL%%/2012/kang//kang.c)
-[Cody](#cody) added alternate code that fixes a problem where in German 'v' -sounds like 'f' which the program has as 'f': with the original version it would -translate 'fier' to '4' when the word is 'vier'. This was during a time that a -lot of entries that no longer worked were fixed and it was done without much -thought but having this alternate version allows one to appreciate the entry -even more so it was kept in. +[Cody](#cody) added the scripts +[en.sh](%%REPO_URL%%/2012/kang/en.sh), [de.sh](%%REPO_URL%%/2012/kang/de.sh) and +[try.sh](%%REPO_URL%%/2012/kang/try.sh). -This change will actually break other translations. It also was a feature, not a -bug, even if it might seem like a bug. But having both versions allows one to -appreciate the entry even more, given how simple the difference is: as has been -seen in many entries over the years, a single character can drastically change -what happens, sometimes in surprising and delightful ways! - -Cody also added six scripts, starting with -[en.sh](%%REPO_URL%%/2012/kang/en.sh), [de.sh](%%REPO_URL%%/2012/kang/de.sh), -[en.alt.sh](%%REPO_URL%%/2012/kang/en.alt.sh) and -[de.alt.sh](%%REPO_URL%%/2012/kang/de.alt.sh) which count from 0 through 13 in -English and German using the original entry and the alt version respectively. - -In the German scripts it uses the umlaut and also does it without the umlaut -(add an 'e'). Notice how the program picks up on this! All scripts can use -either version but the `.alt.sh` versions default to the `alt` version whereas -the other defaults to the submitted entry. See the index.html for details. - -The fifth and sixth scripts, [try.sh](%%REPO_URL%%/2012/kang/try.sh) and -[try.alt.sh](%%REPO_URL%%/2012/kang/try.alt.sh), run a sequence of commands to -show different languages and numbers with the submitted and alternate version -respectively. Notice how a single letter changes so much! +In the German script it uses the umlaut for five (`fünf`) and also does it +without the umlaut (add an 'e' i.e. `fuenf`). Notice how the program picks up on +this!