diff --git a/1995/dodsond1/try.sh b/1995/dodsond1/try.sh index dd17ce931..817cb73dc 100755 --- a/1995/dodsond1/try.sh +++ b/1995/dodsond1/try.sh @@ -1,6 +1,21 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1995/dodsond1 +# -make all >/dev/null || exit 1 +# get CC + +# 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 echo "$ cat try.this.txt" cat try.this.txt diff --git a/1995/esde/try.sh b/1995/esde/try.sh index f8e63399d..e64239021 100755 --- a/1995/esde/try.sh +++ b/1995/esde/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1995/esde +# -make all >/dev/null || exit 1 +# 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 echo "$ ./esde esde.data Johanson" ./esde esde.data Johanson diff --git a/1996/august/try.sh b/1996/august/try.sh index 16a76c35b..ca8898933 100755 --- a/1996/august/try.sh +++ b/1996/august/try.sh @@ -1,6 +1,20 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1996/august +# + +# 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 -make clobber all set -x cat august.c test.oc | ./august > test.oo ./august < test.oo @@ -14,7 +28,12 @@ cat parse.oo fac.oc | ./august | ./august rm august.oc make august.oc + +# this next step is vital for some compilers! Not having it will make the +# compiler create code that enters an infinite loop. This is known to happen in +# macOS as one example. sed -i'' '/^#/d' august.oc + cat august.c august.oc | ./august > august.oo cat august.oo test.oo | ./august cat august.oo august.oo fac.oo | ./august diff --git a/1996/gandalf/try.sh b/1996/gandalf/try.sh index 03128d772..b7dd5acbb 100755 --- a/1996/gandalf/try.sh +++ b/1996/gandalf/try.sh @@ -1,6 +1,22 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1996/gandalf +# +# BTW: it is absolutely perilous to 'try' the patience of Gandalf: go ahead, +# 'try it'! :-) +# -make all 1>/dev/null || exit 1 +# 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 # remove temporary files to show later rm -f hatcat.txt cathat.txt hatcat2.txt cathat2.txt hatcat3.txt cathat3.txt diff --git a/1996/schweikh2/try.sh b/1996/schweikh2/try.sh index e95e3f1db..de86a4934 100755 --- a/1996/schweikh2/try.sh +++ b/1996/schweikh2/try.sh @@ -1,7 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1996/schweikh2 +# -make all >/dev/null || exit 1 +# 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 to run ./schweikh2: " 1>&2 ./schweikh2 diff --git a/1996/westley/try.alt.sh b/1996/westley/try.alt.sh index 0adf8e87c..6c9e4c480 100755 --- a/1996/westley/try.alt.sh +++ b/1996/westley/try.alt.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.alt.sh - demonstrate IOCCC winner 1996/westley alt code +# -make everything 1>/dev/null || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Showing alt grandfather clock:" 1>&2 WESTLEY=./westley.alt ./clock1.sh diff --git a/1996/westley/try.sh b/1996/westley/try.sh index 8dea325ff..56cd8abe7 100755 --- a/1996/westley/try.sh +++ b/1996/westley/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1996/westley +# -make everything 1>/dev/null || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Showing grandfather clock:" 1>&2 WESTLEY=./westley ./clock1.sh diff --git a/1998/bas2/try.sh b/1998/bas2/try.sh index 08a76ae35..2bcacde81 100755 --- a/1998/bas2/try.sh +++ b/1998/bas2/try.sh @@ -1,13 +1,19 @@ #!/usr/bin/env bash # -# try.sh - demonstrate 1998/bas2 -# -# If any args are specified it checks if it's a readable file and if it is it -# feeds it to the program. If not it assumes it's a string and feeds that to the -# program. +# try.sh - demonstrate IOCCC winner 1998/bas2 # -make all || exit 1 +# 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 echo "$ ./bas2 < bas2.c" 1>&2 ./bas2 < bas2.c diff --git a/1998/dorssel/try.sh b/1998/dorssel/try.sh index caad9ec87..830cddfd2 100755 --- a/1998/dorssel/try.sh +++ b/1998/dorssel/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash # -# script to show 1998/dorssel +# try.sh - demonstrate IOCCC winner 1998/dorssel +# + +# 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 echo "$ echo 'Simple as 123' | ./dorssel" 1>&2 echo 'Simple as 123' | ./dorssel diff --git a/1998/fanf/try.sh b/1998/fanf/try.sh index 8622bfb10..8e0bfc016 100755 --- a/1998/fanf/try.sh +++ b/1998/fanf/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1998/fanf +# -make all || exit 1 +# 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 echo "$ echo '((\a(\b(\c(d)))) e' | ./fanf" 1>&2 echo '((\a(\b(\c(d)))) e)' | ./fanf diff --git a/1998/schnitzi/try.sh b/1998/schnitzi/try.sh index 4b71a27a2..90817251e 100755 --- a/1998/schnitzi/try.sh +++ b/1998/schnitzi/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1998/schnitzi +# -make all || exit 1 +# 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 echo "$ ./schnitzi 3 > sort.c" 1>&2 ./schnitzi 3 > sort.c diff --git a/1998/schweikh3/try.sh b/1998/schweikh3/try.sh index 4cc96b92c..ffd2b88b2 100755 --- a/1998/schweikh3/try.sh +++ b/1998/schweikh3/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1998/schweikh3 +# -make all || exit 1 +# 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 echo "$ cp -f schweikh3 file1" cp -f schweikh3 file1 diff --git a/1998/tomtorfs/try.sh b/1998/tomtorfs/try.sh index b3189d7c0..f68f90c27 100755 --- a/1998/tomtorfs/try.sh +++ b/1998/tomtorfs/try.sh @@ -1,8 +1,20 @@ #!/usr/bin/env bash # -# script to demonstrate 1998/tomtorfs +# try.sh - demonstrate IOCCC winner 1998/tomtorfs # +# 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 + rm -f file.A file.B file.C echo "$ echo abscond conferrable > file.A" 1>&2 diff --git a/2000/tomx/try.alt.sh b/2000/tomx/try.alt.sh index 1d8f730d8..0ffb04090 100755 --- a/2000/tomx/try.alt.sh +++ b/2000/tomx/try.alt.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash -# -# try.sh - script to show 2000/tomx +# +# try.alt.sh - demonstrate IOCCC winner 2000/tomx alt code +# + +# 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" alt >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Using tomx.alt.c to compile mkentry.c directly:" 1>&2 echo "$ chmod +x tomx.alt.c" 1>&2 diff --git a/2000/tomx/try.sh b/2000/tomx/try.sh index db719b5b8..e3bb764dc 100755 --- a/2000/tomx/try.sh +++ b/2000/tomx/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash -# -# try.sh - script to show 2000/tomx +# +# 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 if [[ ! -f "tomx" || ! -e "tomx" ]]; then echo "Compiling tomx.c:" 1>&2 diff --git a/2001/anonymous/try.sh b/2001/anonymous/try.sh index fc509fca7..71330cfc5 100755 --- a/2001/anonymous/try.sh +++ b/2001/anonymous/try.sh @@ -1,7 +1,21 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2001/anonymous +# -make clobber alt all >/dev/null 2>&1 +# 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 +# in this case we won't fail if we can't compile the code because we can still +# run the supplementary program. +make CC="$CC" everything >/dev/null + +# clear screen after compilation so that only the entry is shown +clear TARGET="anonymous.ten" if [[ -f "$TARGET" ]]; then @@ -28,6 +42,7 @@ if [[ -f "$TARGET" ]]; then else echo "cannot compile anonymous.ten.c as 32-bit, sorry." echo "will run 64-bit version directly." + make anonymous.ten.64 sleep 3 echo "$ ./$TARGET.64" ./"$TARGET".64 diff --git a/2011/akari/try.sh b/2011/akari/try.sh index 08cc310ef..8c5846d1e 100755 --- a/2011/akari/try.sh +++ b/2011/akari/try.sh @@ -1,6 +1,24 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2011/akari +# -make clobber akari || exit 1 +# 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 + +# in this case we won't fail if we can't compile the code because we can still +# run the supplementary program. +make CC="$CC" all >/dev/null + +# clean out old binaries except the entry itself +rm -f akari2 akari3 akari4 + +# clear screen after compilation so that only the entry is shown +clear ./akari < example.ppm > odd_output.ppm ./akari - - even < example.ppm > even_output.ppm diff --git a/2011/dlowe/try.sh b/2011/dlowe/try.sh index add9107e1..5ba749b1e 100755 --- a/2011/dlowe/try.sh +++ b/2011/dlowe/try.sh @@ -1,6 +1,21 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2011/dlowe +# -make clobber dlowe || exit 1 +# 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 + +# in this case we won't fail if we can't compile the code because we can still +# run the supplementary program. +make CC="$CC" all >/dev/null + +# clear screen after compilation so that only the entry is shown +clear ./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net ./dlowe dlowe < dlowe-aux-data/ioccc-winlose-trained.net diff --git a/2012/kang/de.alt.sh b/2012/kang/de.alt.sh index fd5de0723..c5449d4be 100755 --- a/2012/kang/de.alt.sh +++ b/2012/kang/de.alt.sh @@ -8,7 +8,17 @@ # What does it get right and what does it get wrong? Why does it get what it # gets wrong wrong? -make everything || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear # set up path to program if not set if [[ -z "$KANG" ]]; then diff --git a/2012/kang/de.sh b/2012/kang/de.sh index 2d0dbf622..75e59b99c 100755 --- a/2012/kang/de.sh +++ b/2012/kang/de.sh @@ -8,7 +8,17 @@ # What does it get right and what does it get wrong? Why does it get what it # gets wrong wrong? -make everything || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear # set up path to program if not set if [[ -z "$KANG" ]]; then diff --git a/2012/kang/en.alt.sh b/2012/kang/en.alt.sh index afc61e430..098a0d5f3 100755 --- a/2012/kang/en.alt.sh +++ b/2012/kang/en.alt.sh @@ -5,7 +5,17 @@ # What does it get right and what does it get wrong? Why does it get what it # gets wrong wrong? -make everything || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear # set up path to program if not set if [[ -z "$KANG" ]]; then diff --git a/2012/kang/en.sh b/2012/kang/en.sh index 995c4d6e6..02aa3e808 100755 --- a/2012/kang/en.sh +++ b/2012/kang/en.sh @@ -5,7 +5,18 @@ # What does it get right and what does it get wrong? Why does it get what it # gets wrong wrong? -make everything || exit 1 + +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear # set up path to program if not set if [[ -z "$KANG" ]]; then diff --git a/2012/kang/try.sh b/2012/kang/try.sh index 97bec68f4..fa08e6771 100755 --- a/2012/kang/try.sh +++ b/2012/kang/try.sh @@ -1,6 +1,18 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2012/kang -make everything || exit 1 +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "$ echo Nineteen hundred and eighty-four | ./kang" echo Nineteen hundred and eighty-four | ./kang diff --git a/2013/birken/try.sh b/2013/birken/try.sh index 1790cfb70..faaa5a513 100755 --- a/2013/birken/try.sh +++ b/2013/birken/try.sh @@ -1,6 +1,18 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2013/birken -make clobber everything 2>/dev/null +# 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear if [[ -z "$BIRKEN" ]]; then BIRKEN="birken.alt"