diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md index 1cfb41ccb..3df3eb84b 100644 --- a/1985/lycklama/README.md +++ b/1985/lycklama/README.md @@ -31,18 +31,7 @@ make SLEEP=700 clobber alt which would set it at 700. Then, whether you use the default value or not, try: ```sh -./lycklama.alt < lycklama.c - -# notice the difference between the above and this one: -./lycklama.alt < lycklama.alt.c - -# also try: -./lycklama.alt < lycklama.orig.c - -./lycklama.alt < README.md - -./lycklama.alt < Makefile - +./try.alt.sh ``` diff --git a/1985/lycklama/try.alt.sh b/1985/lycklama/try.alt.sh new file mode 100755 index 000000000..20dd5bc88 --- /dev/null +++ b/1985/lycklama/try.alt.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# +# try.alt.sh - demonstrate IOCCC winner 1985/lycklama alt code +# + +# 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" alt >/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: ./lycklama.alt < lycklama.c: " +echo 1>&2 +./lycklama.alt < lycklama.c +echo 1>&2 + +# notice the difference between the above and this one: +echo "Notice the difference with the above and this next one." 1>&2 +read -r -n 1 -p "Press any key to run: ./lycklama.alt < lycklama.alt.c: " +echo 1>&2 +./lycklama.alt < lycklama.alt.c +echo 1>&2 + +# also try: +read -r -n 1 -p "Press any key to run: ./lycklama.alt < lycklama.orig.c: " +echo 1>&2 +./lycklama.alt < lycklama.orig.c +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./lycklama.alt < README.md: " +echo 1>&2 +./lycklama.alt < README.md +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./lycklama.alt < Makefile: " +echo 1>&2 +./lycklama.alt < Makefile diff --git a/thanks-for-help.md b/thanks-for-help.md index dfcfa73eb..866978ace 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -206,6 +206,8 @@ changed the `#o` lines to `#define`. Also `unistd.h` had to be `#include`d. [Yusuke](#yusuke) provided some useful information that amounts to an alternate version that Cody added. See the README.md for details. +Cody also provided the [try.alt.sh](/1985/lycklama/try.alt.sh) script. + ## [1985/shapiro](/1985/shapiro/shapiro.c) ([README.md](/1985/shapiro/README.md]))