From d70df4a6a139b576679633c6db3d5b800e0be6c0 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 25 Nov 2023 11:39:14 -0800 Subject: [PATCH] Fix 2011/konno + add try.sh + format/typo checks As it was NOT a documented feature the program now checks for an arg before proceeding. Add try.sh. Format/typo check README.md file. This should complete the review of this entry. --- 2011/konno/README.md | 10 ++++------ 2011/konno/konno.c | 2 +- 2011/konno/try.sh | 33 +++++++++++++++++++++++++++++++++ thanks-for-fixes.md | 8 ++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100755 2011/konno/try.sh diff --git a/2011/konno/README.md b/2011/konno/README.md index 053350046..f2d5a6652 100644 --- a/2011/konno/README.md +++ b/2011/konno/README.md @@ -15,21 +15,19 @@ make ### Try: ```sh -./konno qwerty -./konno ioccc -./konno "the quick brown fox jumps over the lazy dog" +./try.sh ``` ## Judges' remarks: -This tiny program outputs what looks like a tiny keyboard.\ -OK, so the letters are missing. But that is no problem because\ +This tiny program outputs what looks like a tiny keyboard. +OK, so the letters are missing. But that is no problem because this program identifies the lower case letters that were pressed! It is one of those minimal keyboards without all of those confusing symbols keys. No shift for SHOUTING CAPS -but at least it does not have that useless caps lock key! +but at least it does not have that useless CAPS LOCK key! We recommend that you completely deconstruct / figure out how this program works and does what it does. Can you diff --git a/2011/konno/konno.c b/2011/konno/konno.c index 1db5ef38a..d621b0f8d 100644 --- a/2011/konno/konno.c +++ b/2011/konno/konno.c @@ -1 +1 @@ -main(_,l)char**l;{6*putchar(--_%20?_+_/21&56>_?strchr(1[l],_^"pt`u}rxf~c{wk~zyHHOJ]QULGQ[Z"[_/2])?111:46:32:10)^_&&main(2+_,l);} +main(_,l)char**l;{if(_>1){6*putchar(--_%20?_+_/21&56>_?strchr(1[l],_^"pt`u}rxf~c{wk~zyHHOJ]QULGQ[Z"[_/2])?111:46:32:10)^_&&main(2+_,l);}} diff --git a/2011/konno/try.sh b/2011/konno/try.sh new file mode 100755 index 000000000..077f38f53 --- /dev/null +++ b/2011/konno/try.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2011/konno +# + +# 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" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + + +echo "$ ./konno qwerty" 1>&2 +./konno qwerty +echo 1>&2 + +echo "$ ./konno ioccc" 1>&2 +./konno ioccc +echo 1>&2 + +echo "$ ./konno \"the quick brown fox jumps over the lazy dog\"" 1>&2 +./konno "the quick brown fox jumps over the lazy dog" +echo 1>&2 + +echo "$ ./konno \"\"" 1>&2 +./konno "" + diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index b02b42594..5c2d473ac 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3226,6 +3226,14 @@ and now it does work with 64-bit systems as well as 32-bit systems. Cody added the following words of wisdom: 'this is not a pipe'. +## [2011/konno](2011/konno/konno.c) ([README.md](2011/konno/README.md])) + +Cody fixed the program to not crash if no arg was specified as this was not a +documented feature. + +Cody also added the [try.sh](2011/konno/try.sh) script. + + ## [2011/richards](2011/richards/richards.c) ([README.md](2011/richards/README.md])) Cody fixed a minor problem that showed up in both linux and macOS. He notes