From 0120eac02b2725f41e080dd78eea4f1faf819c24 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 27 Jan 2024 11:35:00 -0800 Subject: [PATCH] Add 2013/hou/try.sh --- 2013/hou/README.md | 15 ++++++--------- 2013/hou/try.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ thanks-for-help.md | 2 ++ 3 files changed, 54 insertions(+), 9 deletions(-) create mode 100755 2013/hou/try.sh diff --git a/2013/hou/README.md b/2013/hou/README.md index cacaf70ac..4e2655cbd 100644 --- a/2013/hou/README.md +++ b/2013/hou/README.md @@ -30,17 +30,14 @@ effects should be more or less recognizable when you see 16. ## Try: ```sh -./hou BIG -./hou old_default.scene BIG -./hou otherroom.scene -./hou otherroom.scene NAIVE +./try.sh ``` -Try opening the file and then let the program run a while and every so often -reopen the file, to see how it changes. The author suggests that you leave the -program running overnight to see what happens. If however you do not have all -night :-) then the following JPEG files should show you what happens with some -of the invocations above: +Try opening the file noted by the program then let the program run a while and +every so often reopen the file, to see how it changes. The author suggests that +you leave the program running overnight to see what happens. If however you do +not have all night :-) then the following JPEG files should show you what +happens with some of the invocations above: ![./hou BIG - Luna](luna.jpg) diff --git a/2013/hou/try.sh b/2013/hou/try.sh new file mode 100755 index 000000000..d5ef47743 --- /dev/null +++ b/2013/hou/try.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2013/hou +# + +# 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 + +echo "2013/hou menu" 1>&2 +echo 1>&2 +echo "(0) BIG (luna.ppm)" 1>&2 +echo "(1) old_default.scene BIG (old_default.ppm)" 1>&2 +echo "(2) otherroom (otherroom.ppm)" 1>&2 +echo "(3) NAIVE otherroom (otherroom.ppm)" 1>&2 +echo 1>&2 +read -rp "Make your selection (0 - 3, anything else to quit): " mode + +case "$mode" in + 0) # BIG + echo "$ ./hou BIG" 1>&2 + ./hou BIG + ;; + 1) # old_default BIG + echo "$ ./hou old_default.scene BIG" 1>&2 + ./hou old_default.scene BIG + ;; + 2) # otherroom + echo "$ ./hou otherroom.scene" 1>&2 + ./hou otherroom.scene + ;; + 3) # otherroom NAIVE + echo "$ ./hou otherroom.scene NAIVE" 1>&2 + ./hou otherroom.scene NAIVE + ;; + *) exit 0 + ;; +esac diff --git a/thanks-for-help.md b/thanks-for-help.md index 4c3c86c59..68ed2718c 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4031,6 +4031,8 @@ Further, after the file `2013/hou/doc/example.markdown` was moved to [2013/hou/doc/example.md](/2013/hou/doc/example.md) to match the rest of the repo this broke `make` which Cody also fixed. +Cody also added the [try.sh](/2013/hou/try.sh) script. + ## [2013/mills](/2013/mills/mills.c) ([README.md)[2013/mills/README.md))