diff --git a/1995/vanschnitz/README.md b/1995/vanschnitz/README.md index fbf4a7107..a2df9bd5a 100644 --- a/1995/vanschnitz/README.md +++ b/1995/vanschnitz/README.md @@ -29,8 +29,7 @@ For more detailed information see [1995 vanschnitz in bugs.md](/bugs.md#1995-van ## Try: ```sh -make clobber all LEVEL=6 -./vanschnitz +./try.sh ``` diff --git a/1995/vanschnitz/try.sh b/1995/vanschnitz/try.sh new file mode 100755 index 000000000..e3939a461 --- /dev/null +++ b/1995/vanschnitz/try.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1995/vanschnitz +# + +# 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: ./vanschnitz (space = next page, q = quit): " +echo 1>&2 +./vanschnitz | less -rEXF +echo 1>&2 + +for i in $(seq 1 6); do + read -r -n 1 -p "Press any key to set level at $i (make clobber all LEVEL=$i): " + echo 1>&2 + make clobber all LEVEL="$i" + read -r -n 1 -p "Press any key to run: ./vanschnitz (space = next page, q = quit): " + echo 1>&2 + ./vanschnitz | less -rEXF +done diff --git a/thanks-for-help.md b/thanks-for-help.md index 6fd8e5654..6e00d929e 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2087,6 +2087,8 @@ cases all the code should be available for the wider audience, without having to extract it. The exception is when the files are created by the entry or the entry decrypts the text or something like that. +Cody also added the [try.sh](/1995/vanschnitz/try.sh) script. + # 1996