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()`.