diff --git a/2020/kurdyukov3/README.md b/2020/kurdyukov3/README.md index 004aa45ba..326627ac7 100644 --- a/2020/kurdyukov3/README.md +++ b/2020/kurdyukov3/README.md @@ -4,6 +4,9 @@ make ``` +There is an alternate version of this program. See [Alternate +code](#alternate-code) below. + ## To use: @@ -15,27 +18,24 @@ make ### Try: ```sh -# first input to try -echo first input to try | ./prog - -# try reading this output -echo International Obfuscated C Code Contest | ./prog - -# try reading this other output -./prog < input.txt +./try.sh ``` ## Alternate code: -There is an alternate version of this code in `prog.alt.c` where the main code is a macro. +The alternate version, [prog.alt.c](prog.alt.c), has the main code as a macro. -To compile this alternate version: + +### Alternate build: ```sh make alt ``` + +### Alternate use: + Use `prog.alt` as you would `prog` above. @@ -50,12 +50,15 @@ languages) is called [typoglycemia](https://www.mrc-cbu.cam.ac.uk/personal/matt.davis/Cmabrigde/) (the article however is incorrect in stating that if the letters were more jumbled or if other words were formed one could not read it: we know of some who -can in fact do exactly that). +can in fact do exactly that). Also, to be clear, there was no such study stated +in [input.txt](input.txt) but as you'll likely see you should be able to do +exactly what it says nonetheless. ## Author's remarks: -### Letter Mixer ### + +### Letter Mixer Compile and try this: @@ -63,7 +66,9 @@ Compile and try this: cat input.txt | ./prog ``` -The program can work with letters that are not represented in English, as long as these letters are encoded in the higher part of the single-byte character set (use `iconv` to convert from UTF-8 and back). +The program can work with letters that are not represented in English, as long +as these letters are encoded in the higher part of the single-byte character set +(use `iconv` to convert from UTF-8 and back). ## Copyright and CC BY-SA 4.0 License: diff --git a/2020/kurdyukov3/input.txt b/2020/kurdyukov3/input.txt index 702b7a0e2..cabe63a31 100644 --- a/2020/kurdyukov3/input.txt +++ b/2020/kurdyukov3/input.txt @@ -1 +1,4 @@ -Using the incredible power of the human brain, according to research at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be in the right place. The rest can be a total, mess and you can read it without a problem. +Using the incredible power of the human brain, according to research at +Cambridge University, it doesn't matter in what order the letters in a word +are, the only important thing is that the first and last letter be in the right +place. The rest can be a total, mess and you can read it without a problem. diff --git a/2020/kurdyukov3/try.sh b/2020/kurdyukov3/try.sh new file mode 100755 index 000000000..9b386af92 --- /dev/null +++ b/2020/kurdyukov3/try.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2020/kurdyukov2 +# + +# 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 + +# first input to try +read -r -n 1 -p "Press any key to run: echo first input to try | ./prog: " +echo 1>&2 +echo first input to try | ./prog +echo 1>&2 + +# try reading this output +read -r -n 1 -p "Press any key to run: echo International Obfuscated C Code Contest | ./prog: " +echo 1>&2 +echo International Obfuscated C Code Contest | ./prog +echo 1>&2 + +# try reading this other output +read -r -n 1 -p "Press any key to show input.txt: " +echo 1>&2 +cat input.txt +echo 1>&2 +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./prog < input.txt: " +echo 1>&2 +./prog < input.txt diff --git a/thanks-for-help.md b/thanks-for-help.md index 7cc38fd72..c2b20c6e4 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4417,6 +4417,15 @@ the user has installed the appropriate library with `/opt/local`). +## [2020/kurdyukov3](/2020/kurdyukov3/prog.c) ([README.md](/2020/kurdyukov3/README.md)) + +[Cody](#cody) added the [try.sh](/2020/kurdyukov3/try.sh) script. + +He also added a link that has much more details about this phenomenon to the +README.md. Naturally he's one of the ones who can read text even if it's even +more jumbled but we know of others too. + + ## [2020/tsoj](/2020/tsoj/prog.c) ([README.md](/2020/tsoj/README.md)) [Cody](#cody) added [alternate code](/2020/tsoj/README.md#alternate-code) that will feel