From 8f7fce9fec39ae94848747463782692ec8dab84e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 23 Dec 2023 09:19:10 -0800 Subject: [PATCH] Add 1986/bright/try.sh --- 1986/bright/README.md | 4 +--- 1986/bright/try.sh | 26 ++++++++++++++++++++++++++ thanks-for-help.md | 5 +++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 1986/bright/try.sh diff --git a/1986/bright/README.md b/1986/bright/README.md index 154ecff9b..40c779acf 100644 --- a/1986/bright/README.md +++ b/1986/bright/README.md @@ -15,9 +15,7 @@ make all ### Try: ```sh -./bright bright.c - -./bright bright +./try.sh ``` diff --git a/1986/bright/try.sh b/1986/bright/try.sh new file mode 100755 index 000000000..ed7eef0bb --- /dev/null +++ b/1986/bright/try.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2000/tomx +# + +# 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: ./bright bright.c (space = next page, q = quit): " +echo 1>&2 +./bright bright.c | less -rEXF +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./bright bright | tail -n 15: " +echo 1>&2 +./bright bright | tail -n 15 diff --git a/thanks-for-help.md b/thanks-for-help.md index ae0466a3f..bb08c871b 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -340,6 +340,11 @@ Cody also added the [try.sh](/1985/sicherman/try.sh) script. ./applin.c` or `./applin`; they can do either `./applin.c` or `./applin`. +## [1986/bright](/1986/bright/bright.c) ([README.md](/1986/bright/README.md])) + +[Cody](#cody) added the [try.sh](1986/bright/try.sh) script. + + ## [1986/hague](/1986/hague/hague.c) ([README.md](/1986/hague/README.md])) [Cody](#cody) made this use `fgets()`.