diff --git a/2013/cable1/README.md b/2013/cable1/README.md index e5628c2ac..036dad757 100644 --- a/2013/cable1/README.md +++ b/2013/cable1/README.md @@ -15,11 +15,7 @@ make ### Try: ```sh -./cable1 obama republican democrat -./cable1 nixon republican democrat -./cable1 bush republican democrat -./cable1 kennedy republican democrat -./cable1 lincoln republican democrat +./try.sh ``` @@ -69,7 +65,7 @@ A PC guy as expected. What about that other Steve? Humm .. maybe there is a hidden reason he is leaving the late Micro$oft? :-) Why late? Because: -![tweet about M$ being dead](https://twitter.com/landonnoll/status/401582967123742720) +![tweet about M$ being dead](dead-ms-tweet.jpg) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- An important 2023 update about twitter: @@ -102,6 +98,7 @@ case, and prints out their political affiliation. Use `republican` as the 2nd command-line argument, and `democrat` as the 3rd (or equivalent strings of your choice). + ### Why is this entry obfuscated/interesting? The program looks up the name supplied on the command line against a list of @@ -117,6 +114,7 @@ table? - This program needs a little endian CPU to work properly. + ### Compiler warnings `clang` warns about a missing type specifier for `main()`, and that implicit diff --git a/2013/cable1/dead-ms-tweet.jpg b/2013/cable1/dead-ms-tweet.jpg new file mode 100644 index 000000000..db8da7854 Binary files /dev/null and b/2013/cable1/dead-ms-tweet.jpg differ diff --git a/2013/cable1/try.sh b/2013/cable1/try.sh new file mode 100755 index 000000000..e080673ab --- /dev/null +++ b/2013/cable1/try.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2013/cable1 +# + +# 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 + +read -r -n 1 -p "Press any key to run: ./cable1 obama republican democrat: " +echo 1>&2 +./cable1 obama republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 nixon republican democrat: " +echo 1>&2 +./cable1 nixon republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 bush republican democrat: " +echo 1>&2 +./cable1 bush republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 kennedy republican democrat: " +echo 1>&2 +./cable1 kennedy republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 lincoln republican democrat: " +echo 1>&2 +./cable1 lincoln republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 roosevelt republican democrat: " +echo 1>&2 +./cable1 roosevelt republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./cable1 fdr republican democrat: " +echo 1>&2 +./cable1 fdr republican democrat +echo 1>&2 + +read -r -n 1 -p "Press any key: ./cable1 microsoft alive dead: " +echo 1>&2 +./cable1 microsoft alive dead +echo 1>&2 diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index f768cf8b1..6f3426539 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3489,6 +3489,12 @@ Cody also added the [try.sh](2013/birken/try.sh) script for the entry and the [try.alt.sh](2013/birken/try.alt.sh) script for the alt code. +## [2013/cable1](2013/cable1/cable1.c) ([README.md](2013/cable1/README.md])) + +[Cody](#cody) added the [try.sh](2013/cable1/try.sh) script which also has an +joke Easter egg in it based on the judges' remarks. + + ## [2013/cable3](2013/cable3/cable3.c) ([README.md](2013/cable3/README.md])) [Cody](#cody) fixed this to compile with modern systems. The problems were that