From 26edb2a70a67c9c65c8d8fd4356fd9fddb9481c5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 12 Dec 2023 05:17:43 -0800 Subject: [PATCH] Improve how to redefine sleep in 2013/birken alt Now one can just do make clobber SLEEP=500 alt or whatever. --- 2013/birken/Makefile | 11 ++++++++--- 2013/birken/README.md | 2 +- thanks-for-help.md | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/2013/birken/Makefile b/2013/birken/Makefile index 1f6f6e1d5..1ff919e35 100644 --- a/2013/birken/Makefile +++ b/2013/birken/Makefile @@ -57,7 +57,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=15000 +CDEFINE= # Include files that are needed to compile # @@ -139,13 +139,18 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +# Variable to control how to redefine sleep time in alt code +# +SLEEP= 15000 + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + # data files # data: ${DATA} diff --git a/2013/birken/README.md b/2013/birken/README.md index b7f89f8e0..679f51b65 100644 --- a/2013/birken/README.md +++ b/2013/birken/README.md @@ -40,7 +40,7 @@ compile time. If you wish to speed it up by 100% you can instead do: ```sh -make clobber CDEFINE=-DZ=7500 alt +make clobber SLEEP=7500 alt ``` and then try `birken.alt` as above. diff --git a/thanks-for-help.md b/thanks-for-help.md index b0b464957..3363a9324 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3491,11 +3491,13 @@ pairs though that should be obvious) and also some that are correct including system("reset");` (via redefining `exit(3)` so that the column ending would be the same) so that as long as it runs to completion the terminal will be sane and the cursor will be visible. Using `atexit(3)` will not work if the program is -killed and signals are ugly so this was not done. +killed, signals are ugly and these would be messing with the entry too much so +these were not done. Cody also added the alt version that lets one control how fast the painting is done, based on the author's recommendations, except that Cody made it -configurable at compile time. +configurable at compile time. The Makefile was modified in such a way as to make +it very easy to redefine them at compile time. Cody also added the [try.sh](/2013/birken/try.sh) script for the entry and the [try.alt.sh](/2013/birken/try.alt.sh) script for the alt code.