From dcc3fc8f5962da6532ceb4c85f100e87332ab3e1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 4 Dec 2023 08:33:39 -0800 Subject: [PATCH] Rename 2013/endoh4/run.sh to try.sh + formatting I believe that this completes the review of 2013. --- 2013/endoh4/README.md | 2 ++ 2013/endoh4/{run.sh => try.sh} | 15 ++++++++++++++- thanks-for-fixes.md | 10 +++++----- 3 files changed, 21 insertions(+), 6 deletions(-) rename 2013/endoh4/{run.sh => try.sh} (57%) diff --git a/2013/endoh4/README.md b/2013/endoh4/README.md index 0d79167ce..f9649d0c3 100644 --- a/2013/endoh4/README.md +++ b/2013/endoh4/README.md @@ -65,11 +65,13 @@ This simple spec involves many details. (Note that this program does not use `math.h`.) + ### Portability I think it conforms with both C89 and C99. I confirmed that it worked on gcc, clang, and tcc. It should not be warned with `-pedantic` and `-Wextra`. + ### Tips You may want to use `tput` to hide the terminal cursor. diff --git a/2013/endoh4/run.sh b/2013/endoh4/try.sh similarity index 57% rename from 2013/endoh4/run.sh rename to 2013/endoh4/try.sh index 09d65839a..82b34f2fc 100755 --- a/2013/endoh4/run.sh +++ b/2013/endoh4/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2013/endoh4 +# -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 # set it so that when program is terminated through various signals we re-enable # the cursor diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index d618735fd..b37b7262d 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3589,11 +3589,11 @@ The entry can still be enjoyed if you do not have these tools, however. ## [2013/endoh4](2013/endoh4/endoh4.c) ([README.md](2013/endoh4/README.md)) -[Cody](#cody) added the [run.sh](2013/endoh4/run.sh) script which temporarily turns off -the cursor as suggested by the author, with the addition that if no file is -specified it will feed the source code [endoh4.c](2013/endoh4/endoh4.c) to the -program rather than the file specified. It does not try and detect if the file -exists or can be read as that will be handled by the shell/program. +[Cody](#cody) added the [try.sh](2013/endoh4/try.sh) script which temporarily +turns off the cursor as suggested by the author, with the addition that if no +file is specified it will feed the source code [endoh4.c](2013/endoh4/endoh4.c) +to the program rather than the file specified. It does not try and detect if the +file exists or can be read as that will be handled by the shell/program. ## [2013/hou](2013/hou/hou.c) ([README.md](2013/hou/README.md))