From b85e20aac3c81b96a2d4e2728adf33f190b25364 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 8 Dec 2023 04:48:23 -0800 Subject: [PATCH] Make alt code variables in Makefiles consistent That is the comments have a general form and if they're for the alt code they're defined in the alt code section. If they're for the entry and the alt code they're above the CDEFINE variable. The thanks file has been updated where it was needed. Now only entries that have not been done need this improvement. --- 1985/lycklama/Makefile | 5 +++-- 1985/shapiro/Makefile | 3 ++- 1991/rince/Makefile | 4 +++- 1992/kivinen/Makefile | 4 +++- 1993/cmills/Makefile | 3 ++- 1993/plummer/Makefile | 4 +++- 1993/rince/Makefile | 4 +++- 1994/dodsond2/Makefile | 3 ++- 1998/banks/Makefile | 5 +++-- 1998/schweikh3/Makefile | 6 +++--- 2000/thadgavin/Makefile | 2 +- 2001/kev/Makefile | 2 +- 2004/gavare/Makefile | 9 +++++---- 2004/jdalbec/Makefile | 7 ++++--- 2006/monge/Makefile | 2 +- 2006/sloane/Makefile | 6 +++--- thanks-for-help.md | 17 +++++++++++++---- tmp/things-todo.md | 10 +++------- 18 files changed, 58 insertions(+), 38 deletions(-) diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index 858bd0d80..09394cb0d 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -137,8 +137,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to control amount of time to sleep between writes for alt code. -SLEEP=500 +# Variable to control amount of time to sleep between writes for alt code. +# +SLEEP= 500 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} diff --git a/1985/shapiro/Makefile b/1985/shapiro/Makefile index 6aa897cc0..138b75293 100644 --- a/1985/shapiro/Makefile +++ b/1985/shapiro/Makefile @@ -136,7 +136,8 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to control size of maze for alt code +# Variable to control size of maze for alt code +# SIZE= 39 ${PROG}.alt: ${PROG}.alt.c diff --git a/1991/rince/Makefile b/1991/rince/Makefile index 9c60e9201..c82f537cf 100644 --- a/1991/rince/Makefile +++ b/1991/rince/Makefile @@ -137,8 +137,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to control max number of moves +# Variable to control max number of moves for alt code +# MAXMOVES= 484 + ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} diff --git a/1992/kivinen/Makefile b/1992/kivinen/Makefile index 730917f9d..2e71b8f0a 100644 --- a/1992/kivinen/Makefile +++ b/1992/kivinen/Makefile @@ -138,8 +138,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to control amount of time to sleep between writes for alt code. +# Variable to control amount of time to sleep between writes for alt code. +# SLEEP= 20000 + ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} diff --git a/1993/cmills/Makefile b/1993/cmills/Makefile index 85af27aab..885b5a920 100644 --- a/1993/cmills/Makefile +++ b/1993/cmills/Makefile @@ -141,7 +141,8 @@ chris: ${PROG} alt: data ${ALT_TARGET} @${TRUE} -# variable to control how long to sleep in alt version between updates +# Variable to control amount of time to sleep between updates for alt code. +# SLEEP= 100 ${PROG}.alt: ${PROG}.alt.c diff --git a/1993/plummer/Makefile b/1993/plummer/Makefile index 8107ae4e8..f07320a4f 100644 --- a/1993/plummer/Makefile +++ b/1993/plummer/Makefile @@ -138,8 +138,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to control how long to sleep in alt version +# Variable to control amount of time to sleep between writes for alt code. +# SLEEP= 200 + ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} diff --git a/1993/rince/Makefile b/1993/rince/Makefile index b0d789b75..316135ca1 100644 --- a/1993/rince/Makefile +++ b/1993/rince/Makefile @@ -143,7 +143,9 @@ jkb: ${PROG} alt: data ${ALT_TARGET} @${TRUE} -# variable to control how long to sleep in alt version + +# Variable to control amount of time to sleep between writes for alt code. +# SLEEP= 17 ${PROG}.alt: ${PROG}.alt.c diff --git a/1994/dodsond2/Makefile b/1994/dodsond2/Makefile index 2c276590a..0de5fe3e5 100644 --- a/1994/dodsond2/Makefile +++ b/1994/dodsond2/Makefile @@ -138,7 +138,8 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variable to allow overriding how many arrows to start with +# Variable to set amount of arrows to start with for alt code +# ARROWS= 3 ${PROG}.alt: ${PROG}.alt.c diff --git a/1998/banks/Makefile b/1998/banks/Makefile index 2097f2162..0a6c21064 100644 --- a/1998/banks/Makefile +++ b/1998/banks/Makefile @@ -57,8 +57,8 @@ CSTD= -std=gnu90 # ARCH= -# variables that control the control keys - +# Variables that control the control keys and time step +# IT= XK_Page_Up DT= XK_Page_Down UP= XK_Up @@ -67,6 +67,7 @@ LT= XK_Left RT= XK_Right CS= XK_Return dt= 0.02 + # Defines that are needed to compile # CDEFINE= -DIT=${IT} -DDT=${DT} \ diff --git a/1998/schweikh3/Makefile b/1998/schweikh3/Makefile index fefa31df9..f68255d73 100644 --- a/1998/schweikh3/Makefile +++ b/1998/schweikh3/Makefile @@ -55,9 +55,6 @@ CSTD= -std=gnu90 # ARCH= -# variable for size, primarily for alt code -# -SIZE=32767 # Defines that are needed to compile # CDEFINE= -DM0=sizeof -DM1=long -DM2=void \ @@ -141,6 +138,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# Variable to control size for alt code +# +SIZE=32767 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} diff --git a/2000/thadgavin/Makefile b/2000/thadgavin/Makefile index 551244ba6..15bb5455b 100644 --- a/2000/thadgavin/Makefile +++ b/2000/thadgavin/Makefile @@ -56,7 +56,7 @@ CSTD= -std=gnu99 # ARCH= -# variables for redefining the time to sleep, primarily for alt code +# Variable to control amount of time to sleep between updates for alt code. # SLEEP= 30 SDL_SLEEP= 150000 diff --git a/2001/kev/Makefile b/2001/kev/Makefile index ff6d6e312..edbb9901c 100644 --- a/2001/kev/Makefile +++ b/2001/kev/Makefile @@ -57,7 +57,7 @@ CSTD= -std=gnu99 # ARCH= -# variables for the macros for easier redefining +# Variables that control the port, speed and socket(2) call # PORT= 5455 SPEED= 100 diff --git a/2004/gavare/Makefile b/2004/gavare/Makefile index 18fd65c94..30afe86ac 100644 --- a/2004/gavare/Makefile +++ b/2004/gavare/Makefile @@ -56,10 +56,6 @@ CSTD= -std=gnu99 # ARCH= -# variables for the macros for easier redefining -XX= 1024 -YY= 768 -AA= 3 # Defines that are needed to compile # CDEFINE= -DXX=${XX} -DYY=${YY} -DAA=${AA} @@ -146,6 +142,11 @@ alt: data ${ALT_TARGET} alt2: ${PROG}.alt2 @${TRUE} +# Variables to control the size and anti-aliasing factor for alt code +XX= 1024 +YY= 768 +AA= 3 + ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} diff --git a/2004/jdalbec/Makefile b/2004/jdalbec/Makefile index c3ffea978..ab1ef173a 100644 --- a/2004/jdalbec/Makefile +++ b/2004/jdalbec/Makefile @@ -56,9 +56,6 @@ CSTD= -ansi # ARCH= -# variable for redefining macro Ag -# -Ag= 11 # Defines that are needed to compile # CDEFINE= -DAg=${Ag} @@ -144,6 +141,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# Variable to control how many numbers to print on a line for alt code +# +Ag= 11 + ${PROG}.alt: ${PROG}.alt.c @${RM} -f ${PROG}2.alt.c $@ -${CC} ${CSILENCE} -E ${PROG}.alt.c > ${PROG}2.alt.c diff --git a/2006/monge/Makefile b/2006/monge/Makefile index f1e5045bf..608371895 100644 --- a/2006/monge/Makefile +++ b/2006/monge/Makefile @@ -143,7 +143,7 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} -# variables to help redefine width, height or iterations in alt version +# Variables to control width, height and iterations in alt code # WIDTH= 400 HEIGHT= 300 diff --git a/2006/sloane/Makefile b/2006/sloane/Makefile index bf4edcbbd..184b9d0a3 100644 --- a/2006/sloane/Makefile +++ b/2006/sloane/Makefile @@ -57,9 +57,6 @@ CSTD= -std=gnu99 # ARCH= -# variable to simplify redefining sleep duration for alt code -# -SLEEP= 75000 # Defines that are needed to compile # CDEFINE= -DS=${SLEEP} @@ -143,6 +140,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# Variable to control amount of time to sleep between writes for alt code. +# +SLEEP= 75000 ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} diff --git a/thanks-for-help.md b/thanks-for-help.md index fe7456444..313e15d63 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -1979,12 +1979,17 @@ Later Cody made the entry look more like the original, removing the `argc` in ## [1998/banks](/1998/banks/banks.c) ([README.md](/1998/banks/README.md])) -[Cody](#cody) set up the Makefile to have an alt build (using the same code) for those +[Cody](#cody) improved the Makefile to allow for easier redefining the control +keys and time step that the author set up. + +Cody also set up the Makefile to have an alt build (using the same code) for those who do not have a page up or page down key and added the [keysym.h](/1998/banks/keysym.h) header file as a reference for other keys one can use if they wish to modify the controls. One can certainly do this even if they do have page up and page down but this gives a default for those who don't -have them like with Macs. +have them like with Macs. The alt build hard codes the page up and page down +alternatives because not doing so would overly complicate both builds and since +you can configure them all in both builds it shouldn't matter. ## [1998/bas1](/1998/bas1/bas1.c) ([README.md](/1998/bas1/README.md])) @@ -2599,7 +2604,10 @@ added to `.gitignore` by accident) but Cody restored it from the archive. ## [2001/kev](/2001/kev/kev.c) ([README.md](/2001/kev/README.md])) -[Cody](#cody) slowed down the ball just a tad (it was already a `-D` macro that was used +[Cody](#cody) improved the Makefile to allow one to more easily set up the port, +speed and `socket(2)` call that the author had set up. + +Cody also slowed down the ball just a tad (it was already a `-D` macro that was used in the code) as it went too fast for the speed at which the paddles move even when holding down the movement keys (but see below). @@ -2608,7 +2616,8 @@ the arrow keys on your keyboard instead of the more awkward '`,`' and '`.`'. He updated both versions to have `#ifndef..#endif` pairs for the macros so one can more easily configure different settings without having to specify all of -them. The speed, `SPEED`, will be set to 50 if it's not defined at the compiler +them (though this change became unnecessary with an improvement on how it was +done). The speed, `SPEED`, will be set to 50 if it's not defined at the compiler line as 50 is what it used to be set to. This way it's more to the original but without having to sacrifice playability by running `make`. diff --git a/tmp/things-todo.md b/tmp/things-todo.md index 584cd283f..54289cac6 100644 --- a/tmp/things-todo.md +++ b/tmp/things-todo.md @@ -1,5 +1,5 @@ # A todo list of known things to check and/or do -*Last updated: Thu 07 Dec 2023 19:12:36 UTC* +*Last updated: Fri 08 Dec 2023 12:46:49 UTC* This document is primarily for [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) as he (that is I :-) ) wanted a way @@ -192,9 +192,5 @@ too. The entries done as of 7 Dec 2023 are: - 1991/rince - 1985/shapiro - 1985/lycklama - ... and at least one of them needs to have the thanks file updated as it - helps with the original entry itself. This one is 1998/banks but there might - be more (and there is at least one not done yet that this will apply I - believe). - - + ... and a couple or few involved updating the thanks file as it helps with + the entry itself. Ones not yet done might also have this need.