diff --git a/2004/newbern/README.md b/2004/newbern/README.md index 29ef3ce86..db55cc571 100644 --- a/2004/newbern/README.md +++ b/2004/newbern/README.md @@ -15,8 +15,7 @@ make ## Try: ```sh -./newbern newbern.dat "IOCCC 2004" -echo SOS | ./newbern +./try.sh ``` diff --git a/2004/newbern/try.sh b/2004/newbern/try.sh new file mode 100755 index 000000000..fa2265691 --- /dev/null +++ b/2004/newbern/try.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2004/newbern +# + +# 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: ./newbern newbern.dat \"IOCCC 2004\" (space = next page, q = quit): " +echo 1>&2 +./newbern newbern.dat "IOCCC 2004" | less -rEXF +echo 1>&2 + +read -r -n 1 -p "Press any key to run: echo SOS | ./newbern: " +echo 1>&2 +echo SOS | ./newbern +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./newbern newbern.dat IOCCC x (space = next page, q = quit): " +echo 1>&2 +./newbern newbern.dat IOCCC x | less -rEXF +echo 1>&2 diff --git a/thanks-for-help.md b/thanks-for-help.md index 072dc5554..ce0dd2b57 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3063,6 +3063,10 @@ get it to work, that being `kopczynski-10-rev`. [Cody](#cody) and Landon individually fixed this to work with clang. +Cody also added the [try.sh](/2004/newbern/try.sh) script (with a hidden feature +that the author referred to and was documented by [Yusuke](#yusuke) though Cody +chose the word `IOCCC` instead of `AAA`). + ## [2004/schnitzi](/2004/schnitzi/schnitzi.c) ([README.md](/2004/schnitzi/README.md]))