From cc8478d0cfc83a8fe447b93f7a9ddb8d5508e444 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:41:01 -0800 Subject: [PATCH 01/18] Improve 1995/dodsond1/try.sh Get CC var, defaulting to cc. --- 1995/dodsond1/try.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 From 7182f1a9f46631bc14163c3a38f58a122dbc7049 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:43:30 -0800 Subject: [PATCH 02/18] Improve 1995/esde/try.sh Get CC, defaulting to cc. --- 1995/esde/try.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 From 48e9ffea8f1a6936ce7efe530d54f32ea45bea27 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:48:48 -0800 Subject: [PATCH 03/18] Improve 1996/august/try.sh Get CC defaulting to cc. --- 1996/august/try.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 From e27906cbad42c931d803f23619b51bcbf3b48fd5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:50:05 -0800 Subject: [PATCH 04/18] Improve 1996/gandalf/try.sh Get CC defaulting at cc. BTW: it's absolutely perilous to 'try' the patience of Gandalf. Go ahead, 'try' it! :-) --- 1996/gandalf/try.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 From 6968ea1404584bec4edadccd5dd856cdacdc2be9 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:58:41 -0800 Subject: [PATCH 05/18] Improve 1996/schweikh2/try.sh Get CC, defaulting to cc. --- 1996/schweikh2/try.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 From dbeda86c104ba013025ade28f28eff6e5f81e848 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:00:17 -0800 Subject: [PATCH 06/18] Improve 1996/westley/try.sh and try.alt.sh Get CC, defaulting to cc. --- 1996/westley/try.alt.sh | 15 ++++++++++++++- 1996/westley/try.sh | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) 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 From a6a28c7b878cad19c9ceb81eff52b5646736402d Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:01:18 -0800 Subject: [PATCH 07/18] Improve 1998/bas2/try.sh Get CC, defaulting to cc. --- 1998/bas2/try.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 From 2b7fc96c99b42c371b16f0fcc8d97cd350e2c80b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:03:16 -0800 Subject: [PATCH 08/18] Improve 1998/dorssel/try.sh Get CC, defaulting to cc. --- 1998/dorssel/try.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 From ab73235c02fe9e28c86c0acdd2fba4a23ebe9a99 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:04:03 -0800 Subject: [PATCH 09/18] Improve 1998/fanf/try.sh Get CC, defaulting to cc. --- 1998/fanf/try.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 From d0e87f88a61546b33d3d38b7236cecff05f0c858 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:05:03 -0800 Subject: [PATCH 10/18] Improve 1998/schnitzi/try.sh Get CC, defaulting to cc. --- 1998/schnitzi/try.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 From df5ceaa9f13731517f10c16fc0d40ba62a8041c7 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:06:12 -0800 Subject: [PATCH 11/18] Improve 1998/schweikh3/try.sh Get CC, defaulting to cc. --- 1998/schweikh3/try.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 From a2d34d6fcfe08e7cfe87caaf5a75162a26ba7129 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:07:22 -0800 Subject: [PATCH 12/18] Improve 1998/tomtorfs/try.sh Get CC, defaulting to cc. --- 1998/tomtorfs/try.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 From d73b80bd96246949e2a107c704c5930e90a682e2 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:09:20 -0800 Subject: [PATCH 13/18] Improve 2000/tomx/try.sh and try.alt.sh Get CC, defaulting to cc. --- 2000/tomx/try.alt.sh | 17 +++++++++++++++-- 2000/tomx/try.sh | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) 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 From fc0751ea945b89b01be37da16e889ca35578d50e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:12:18 -0800 Subject: [PATCH 14/18] Fix and improve 2001/anonymous/try.sh It previously would abort if anonymous couldn't be built but this was an error because it will at least run the supplementary program even if the entry or supplementary program cannot be compiled in 32-bit. Get CC, defaulting to cc. --- 2001/anonymous/try.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 From 44580dc3d464ecd5ba44ef4b83c10f9aa0ea53dd Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:15:24 -0800 Subject: [PATCH 15/18] Improve 2011/akari/try.sh Remove additional programs prior to running commands as otherwise if the programs are built it'll show 'up to date' message when running 'make'. Get CC, defaulting to cc. --- 2011/akari/try.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 From 3eeec10b5a2158bc9d77f3ae8997092710c0c5e6 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:17:03 -0800 Subject: [PATCH 16/18] Improve 2011/dlowe/try.sh Get CC, defaulting to cc. --- 2011/dlowe/try.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 From 07c17059052c22d6aa823548d6a1ed21a0eef58f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:20:27 -0800 Subject: [PATCH 17/18] Improve 2012/kang scripts Get CC, defaulting to cc. --- 2012/kang/de.alt.sh | 12 +++++++++++- 2012/kang/de.sh | 12 +++++++++++- 2012/kang/en.alt.sh | 12 +++++++++++- 2012/kang/en.sh | 13 ++++++++++++- 2012/kang/try.sh | 14 +++++++++++++- 5 files changed, 58 insertions(+), 5 deletions(-) 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 From ef8c84a3b1675c91b00a2e09417fd17fea32fb27 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:21:43 -0800 Subject: [PATCH 18/18] Improve 2013/birken/try.sh Get CC, defaulting to cc. --- 2013/birken/try.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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"