Fix alt build of 1995/cdua
The Makefile was missing a SLEEP variable to simplify reconfiguring the usleep(3) (for alt code). Reword the alt code suggestion as well in the README.md.
This commit is contained in:
1 parent
feaf5fe64d
commit
d2f02c5990
2 files changed
+14
-11
No files matched your search
+4
-1
@@ -56,9 +56,12 @@ CSTD= -std=gnu90
|
|||||||
#
|
#
|
||||||
ARCH=
|
ARCH=
|
||||||
|
|
||||||
|
# Variable to simplify reconfiguring sleep time for alt code
|
||||||
|
#
|
||||||
|
SLEEP=3000
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE= -DZ=3000
|
CDEFINE= -DZ=${SLEEP}
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
|
|||||||
+10
-10
@@ -1,17 +1,18 @@
|
|||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
We recommend that you try this alternate version first. For reasons why this is
|
We recommend that you try the alternate version first so you can see what this
|
||||||
see the [original code](#original-code) section below.
|
entry looked like back in 1995 (with a configurable speed). See the [original
|
||||||
|
code](#original-code) section below for the original entry.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make alt
|
make alt
|
||||||
```
|
```
|
||||||
|
|
||||||
This alternate version uses `usleep(3)` with `Z` (defined in the Makefile,
|
The alternate version uses `usleep(3)` with `SLEEP` (defined in the Makefile,
|
||||||
default `3000`) microseconds to make it easier to see the maze being solved in
|
default `3000`) microseconds to make it easier to see the maze being solved in
|
||||||
real time. You can redefine `Z` to reconfigure it in case it's going too slow,
|
real time. You can redefine `SLEEP` at compile time to reconfigure it in case
|
||||||
too fast :-) or you're doing some strange experiment like making it 100000
|
it's going too slow, too fast :-) or you're doing some strange experiment like
|
||||||
(which is actually fun :-) ).
|
making it 100000 (which is actually fun :-) ).
|
||||||
|
|
||||||
|
|
||||||
### Bugs and (Mis)features:
|
### Bugs and (Mis)features:
|
||||||
@@ -34,10 +35,9 @@ For more detailed information see [1995 cdua in bugs.md](/bugs.md#1995-cdua).
|
|||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
To use 1500 for `Z` do:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make CFLAGS="-DZ=1500" clobber alt
|
make SLEEP=1500 clobber alt
|
||||||
|
|
||||||
./cdua.alt # press enter and watch it go much faster!
|
./cdua.alt # press enter and watch it go much faster!
|
||||||
```
|
```
|
||||||
@@ -45,12 +45,12 @@ make CFLAGS="-DZ=1500" clobber alt
|
|||||||
You might also like to try:
|
You might also like to try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make CFLAGS="-DZ=65000" clobber alt
|
make SLEEP=65000 clobber alt
|
||||||
|
|
||||||
./cdua.alt # press enter and watch it go much slower!
|
./cdua.alt # press enter and watch it go much slower!
|
||||||
```
|
```
|
||||||
|
|
||||||
Do you see anything strange in this version when `Z` is a high value like
|
Do you see anything strange in this version when `SLEEP` is a high value like
|
||||||
`65000`? What happens if you use `100000`? Is this strange output still there?
|
`65000`? What happens if you use `100000`? Is this strange output still there?
|
||||||
Why?
|
Why?
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user