diff --git a/2020/otterness/.gitignore b/2020/otterness/.gitignore index eb19e2f8d..a23003a92 100644 --- a/2020/otterness/.gitignore +++ b/2020/otterness/.gitignore @@ -1,8 +1,12 @@ # -# sort with: sort -d -u +# Don't sort because of the exclusion of *.mid with the exception +# of the cvikl.mid and the entertainer.mid. *.dSYM indent indent.c indent.o prog prog.orig +*.mid +!cvikl.mid +!entertainer.mid diff --git a/2020/otterness/README.md b/2020/otterness/README.md index f2761fd08..4527d8128 100644 --- a/2020/otterness/README.md +++ b/2020/otterness/README.md @@ -26,13 +26,12 @@ For more detailed information see [2020 otterness in bugs.md](/bugs.md#2020-otte ## Try: ```sh -./prog < cvikl.mid > output.mid -# Play output.mid with your favorite player - -./prog < entertainer.mid > output2.mid -# Play output2.mid with your favorite player +./try.sh ``` +Now play `output.mid` and `output2.mid` in an audio player that can play MIDI +files. + ## Judges' remarks: diff --git a/2020/otterness/try.sh b/2020/otterness/try.sh new file mode 100755 index 000000000..77a9ba485 --- /dev/null +++ b/2020/otterness/try.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2020/otterness +# + +# 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. +[[ -z "$CC" || ! -f "$CC" || ! -x "$CC" ]] && CC="cc" + +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: ./prog < cvikl.mid > output.mid: " +echo 1>&2 +./prog < cvikl.mid > output.mid +echo "Now play output.wav in an audio player that can play MIDI files." 1>&2 +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./prog < entertainer.mid > output2.mid: " +echo 1>&2 +./prog < entertainer.mid > output2.mid +echo "Now play output2.wav in an audio player that can play MIDI files." 1>&2 +echo 1>&2 diff --git a/thanks-for-help.md b/thanks-for-help.md index cf856a060..e2af75d1f 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4872,6 +4872,8 @@ J.R.R. Tolkien). that one need not download them and to make sure they can always be obtained even if the domain or link goes dead. +Cody also added the [try.sh](/2020/otterness/try.sh) script. + ## [2020/tsoj](/2020/tsoj/prog.c) ([README.md](/2020/tsoj/README.md))