Improve how to redefine max moves in 1991/rince
By a Makefile variable using
make MAXMOVES=N clobber alt
where N is an integer will set the maximum number of moves one may make
in the second alt version (rince.alt2.c) (the first alt version
rince.alt.c has no limit).
This commit is contained in:
1 parent
8f4f9a650a
commit
2277d88ac5
2 files changed
+11
-7
No files matched your search
+4
-2
@@ -58,7 +58,7 @@ ARCH=
|
|||||||
|
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE= -DMAX_MOVES=484
|
CDEFINE= -DMAX_MOVES=${MAXMOVES}
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
@@ -137,11 +137,13 @@ ${PROG}: ${PROG}.c
|
|||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
|
# variable to control max number of moves
|
||||||
|
MAXMOVES=484
|
||||||
${PROG}.alt: ${PROG}.alt.c
|
${PROG}.alt: ${PROG}.alt.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
${PROG}2.alt: ${PROG}.alt2.c
|
${PROG}2.alt: ${PROG}.alt2.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} -DMAX_MOVES=${MAXMOVES} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ that's fewer than the original program.
|
|||||||
|
|
||||||
The first alternate version, [rince.alt.c](rince.alt.c), disables a maximum move
|
The first alternate version, [rince.alt.c](rince.alt.c), disables a maximum move
|
||||||
count so that anyone with enough patience and time can complete the puzzle,
|
count so that anyone with enough patience and time can complete the puzzle,
|
||||||
without having to worry about how many moves they make. The second version,
|
without having to worry about how many moves they make, assuming they don't get
|
||||||
[rince.alt2.c](rince.alt2.c), allows one to reconfigure at compilation the
|
stuck. The second version, [rince.alt2.c](rince.alt2.c), allows one to
|
||||||
maximum number of moves, even if that is lowering the count.
|
reconfigure at compilation the maximum number of moves, even if that is lowering
|
||||||
|
the count.
|
||||||
|
|
||||||
The author set the maximum number of moves to 484.
|
The author set the maximum number of moves to 484.
|
||||||
|
|
||||||
@@ -39,12 +40,13 @@ restrictions in the number of movements and the second one, `rince.alt2`, has a
|
|||||||
configurable maximum number of moves allowed, defaulting to the entry's max,
|
configurable maximum number of moves allowed, defaulting to the entry's max,
|
||||||
484.
|
484.
|
||||||
|
|
||||||
To reconfigure the maximum number of moves:
|
To reconfigure the maximum number of moves to 700:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make clobber CDEFINE+="-DMAX_MOVES=5" alt
|
make clobber MAXMOVES=700 alt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Alternate use:
|
### Alternate use:
|
||||||
|
|
||||||
To run the first alt version:
|
To run the first alt version:
|
||||||
|
|||||||
Reference in new issue
Block a user