diff --git a/1993/ejb/README.md b/1993/ejb/README.md index 51cc9d0e4..57208d11e 100644 --- a/1993/ejb/README.md +++ b/1993/ejb/README.md @@ -18,6 +18,14 @@ level a value from -128 to 127 ``` +## Try: + + +```sh +./try.sh +``` + + ## Judges' remarks: A negative argument plays the patience puzzle. An argument diff --git a/1993/ejb/try.sh b/1993/ejb/try.sh new file mode 100755 index 000000000..cca8f30b4 --- /dev/null +++ b/1993/ejb/try.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1993/ejb +# + +# 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 play the patience puzzle: ./ejb -3: " +echo 1>&2 +./ejb -3 +echo 1>&2 + +read -r -n 1 -p "Press any key to play the Tower of Hanoi puzzle: ./ejb 3: " +echo 1>&2 +./ejb 3 +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./ejb 0: " +echo 1>&2 +./ejb 0 +exit 0 diff --git a/thanks-for-help.md b/thanks-for-help.md index 4d7047f1c..a84ffa18a 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -1716,6 +1716,11 @@ first. [Cody](#cody) fixed the script to work which assumed that `.` is in the path. +## [1993/ejb](/1993/ejb/ejb.c) ([README.md](/1993/ejb/README.md])) + +[Cody](#cody) added the [try.sh](/1993/ejb/try.sh) script. + + ## [1993/jonth](/1993/jonth/jonth.c) ([README.md](/1993/jonth/README.md])) Both [Cody](#cody) and [Yusuke](#yusuke) fixed this so that it will work with modern systems. Yusuke