From 2558cbb5a83ac5fbdefadbb7483e6e86d5d7a089 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:01:41 -0800 Subject: [PATCH] Add 1995/schnitzi/try.sh --- 1995/schnitzi/README.md | 4 +--- 1995/schnitzi/try.sh | 36 ++++++++++++++++++++++++++++++++++++ thanks-for-help.md | 5 +++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100755 1995/schnitzi/try.sh diff --git a/1995/schnitzi/README.md b/1995/schnitzi/README.md index b5a69c4b2..4d5d500eb 100644 --- a/1995/schnitzi/README.md +++ b/1995/schnitzi/README.md @@ -15,9 +15,7 @@ make all ## Try: ```sh -./schnitzi 24 -./schnitzi 18 -./schnitzi 30 +./try.sh ``` WARNING: the author warns to not use too high a number! If you wish to ignore diff --git a/1995/schnitzi/try.sh b/1995/schnitzi/try.sh new file mode 100755 index 000000000..8013bcb64 --- /dev/null +++ b/1995/schnitzi/try.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1995/schnitzi +# + +# 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: ./schnitzi 24 (space = next page, q = quit): " +echo 1>&2 +./schnitzi 24 | less -rEXF +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./schnitzi 18 (space = next page, q = quit): " +echo 1>&2 +./schnitzi 18 | less -rEXF +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./schnitzi 30 (space = next page, q = quit): " +echo 1>&2 +./schnitzi 30 | less -rEXF +echo 1>&2 + + + + diff --git a/thanks-for-help.md b/thanks-for-help.md index 4978c4e7a..6fd8e5654 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2074,6 +2074,11 @@ calls which has the four args. [Cody](#cody) added the [try.sh](/1995/savastio/try.sh) script. +## [1995/schnitzi](/1995/schnitzi/schnitzi.c) ([README.md](/1995/schnitzi/README.md])) + +[Cody](#cody) added the [try.sh](/1995/schnitzi/try.sh) script. + + ## [1995/vanschnitz](/1995/vanschnitz/vanschnitz.c) ([README.md](/1995/vanschnitz/README.md)) [Cody](#cody) added the authors' [spoiler as a C