From 190b7351d75bdcc7e88b3e046ba50f086aed0992 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 24 Mar 2023 12:47:22 -0700 Subject: [PATCH] Fix German vier in 2012/kang Although the judges do note that the entry only gets some of the languages that it supports right it seems to me it should accept vier not fier esp as it gets other numbers right. It did not appear to be a situation where the entry predicts the misspelt words (trying vier did not work) so I think this is correct. If this was intended I am certainly fine with it not being fixed but it appears to be a bug to me. I did a variety of other tests to make sure other numbers are still okay. An example where it detects misspelt words: $ echo secht | ./kang 6 ... instead of sechs for six. But it also gets sechs right. It does not get zehn right but it does get eins right. But as the judges say this is okay. --- 2012/kang/README.md | 7 ++++++- 2012/kang/kang.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/2012/kang/README.md b/2012/kang/README.md index 7bf0ce86d..8edb92c71 100644 --- a/2012/kang/README.md +++ b/2012/kang/README.md @@ -21,10 +21,15 @@ echo "full spelling of an English cardinal numeral less than a quadrillion" | ./ echo Nineteen hundred and eighty-four | ./kang echo uno | ./kang echo trois | ./kang -echo fier | ./kang +echo vier | ./kang echo "shest'" | ./kang ``` +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) changed the code to +accept the proper German for four 'vier' where before it was spelt with the +sound of V (fier not vier). Thank you Cody! + + ## Judges' comments: The judges were able to appreciate the Indo-European language family diff --git a/2012/kang/kang.c b/2012/kang/kang.c index e2058d486..53655c26a 100644 --- a/2012/kang/kang.c +++ b/2012/kang/kang.c @@ -1,5 +1,5 @@ long long n,u,m,b;main(e,r)char **r;{f\ -or(;n++||(e=getchar()|32)>=0;b="ynwtsflrabg"[n%=11]-e?b:b*8+ +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);}