Make current 2012/kang properly alt code

I was on the fence of whether it's a feature or bug that the program
deciphers 'fier' as '4' instead of proper 'vier' but to help with
preventing confusion to those who know German I ended up changing it.
This was thought okay but after more thought and also playing with it a
bit I have made that fix the alt version instead. It so happens that
(and I wondered about this at the time but did not have examples then)
by changing it to 'vier' it caused other number words to be wrong. Thus
the version that I'll call vier (even though it's zwei or if
alternatively if zero based eins :-) ) is now the alt version.

Added en.sh and de.sh scripts to count from 0 through 13 (reason below),
showing the word and number and then the result. One can choose whether
to use the alt version or not by passing in KANG=... to the script like:

    KANG=kang.alt ./de.sh

would run the vier version of kang (kang.alt).

As for why 13 it's to demonstrate two of the German umlauts, ö and ü (in
German you can add an 'e' or 'E' if you don't have the umlaut so it does
both to demonstrate how the program deals with it).

Makefile updated so one can run make alt.

.gitignore updated.

Now the program is how it was and how it should be and yet at the same
time one play with the vier versus fier.
This commit is contained in:
Cody Boone Ferguson committed 2023-10-22 10:29:13 -07:00
1 parent 26f2bafddd
commit 4d71e0e65b
8 files changed
+117 -18

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#!/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 everything || exit 1
# set up path to program if not set
if [[ -z "$KANG" ]]; then
KANG="kang"
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
echo -n "$i (${NUMBERS[$j]}): "
echo "$i"|"./$KANG"
((j++))
done