diff --git a/2000/briddlebane/README.md b/2000/briddlebane/README.md index 6efefa8fc..b439429d3 100644 --- a/2000/briddlebane/README.md +++ b/2000/briddlebane/README.md @@ -17,6 +17,14 @@ make For some fun every time you log in try running this from your `.bashrc` or equivalent file! +You might also like to try: + +```sh +./try.sh + +INSULTS=15 ./try.sh +``` + ## Judges' remarks: diff --git a/2000/briddlebane/try.sh b/2000/briddlebane/try.sh new file mode 100755 index 000000000..7ea8f61cf --- /dev/null +++ b/2000/briddlebane/try.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2000/briddlebane +# + +# 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 + +[[ -z "$INSULTS" ]] && INSULTS=10 +echo "$INSULTS" | grep -qE '^[0-9]+' +if [[ "${PIPESTATUS[1]}" -ne 0 ]]; then + echo "INSULTS value not a positive number, fix and run again." + exit 1 +fi + +for ((i=0; i<"$INSULTS"; i++)); do + ./briddlebane + sleep 1 +done diff --git a/thanks-for-help.md b/thanks-for-help.md index 2344f7401..f4f8ef7f9 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2511,6 +2511,9 @@ terminal. [Cody](#cody) fixed this to compile in systems that require one to explicitly link in `libm`. +Cody also added the [try.sh](/2000/briddlebane/try.sh) script for those who are +feeling a bit too confident, cocky or even happy :-) + ## [2000/dhyang](/2000/dhyang/dhyang.c) ([README.md](/2000/dhyang/README.md]))