Minor update to 1994/weisberg

To make the entry a bit more user friendly and also easier to use with
other tools (in a pipeline - if anyone wanted to for some reason) the
Makefile was modified to print a newline after each number rather than a
space.

I noticed that the Alternate code section had no subsections for
'Alternate build' or 'Alternate use' and these were added as well. I am
not sure how this happened but I might do a quick pass through over all
entries once everything else is done just to be sure.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-25 08:36:28 -08:00
1 parent ae7c8766cb
commit eed35127cc
3 files changed
+30 -4

No files matched your search

+1 -1
View File
@@ -60,7 +60,7 @@ ARCH=
# #
CDEFINE= -Dc='n*n>x?p:((m=*(b+1)),N))' \ CDEFINE= -Dc='n*n>x?p:((m=*(b+1)),N))' \
-DN='((b=t+1),x+=2,x>e?exit(0):o' \ -DN='((b=t+1),x+=2,x>e?exit(0):o' \
-Dp='(a-t<o?*(a++)=x:47),printf("%d ",x),N)' -Dp='(a-t<o?*(a++)=x:47),printf("%d\n",x),N)'
# Include files that are needed to compile # Include files that are needed to compile
# #
+22 -3
View File
@@ -4,6 +4,9 @@
make all make all
``` ```
There is an alternate version that uses more memory. See [alternate
code](#alternate-code) below.
## To use: ## To use:
@@ -12,14 +15,30 @@ make all
``` ```
### Try:
```sh
./weisberg | head -n 15
```
## Alternate code: ## Alternate code:
If you liked what you saw from the above program, and happen to If you liked what you saw from the above program, and happen to
have some 512 Megabytes of virtual memory lying around with to do, have some 512 Megabytes of virtual memory lying around with to do
you could try: something with you might try this version.
### Alternate build:
```sh
make alt
```
### Alternate use:
```sh ```sh
make weisberg.alt
./weisberg.alt ./weisberg.alt
``` ```
+7
View File
@@ -1780,6 +1780,13 @@ more like the original entry this was done in the Makefile.
Note that the alt code does not use `fgets(3)` but rather `gets(3)`. Note that the alt code does not use `fgets(3)` but rather `gets(3)`.
## [1994/weisberg](1994/weisberg/weisberg.c) ([README.md](1994/weisberg/README.md]))
Cody changed the Makefile to make this program more user friendly and easier to
use with other tools as well by making the program output not a space after each
number but rather a newline.
## [1994/westley](1994/westley/westley.c) ([README.md](1994/westley/README.md])) ## [1994/westley](1994/westley/westley.c) ([README.md](1994/westley/README.md]))
Cody converted the spoiler compiler options (provided by the author) to be Cody converted the spoiler compiler options (provided by the author) to be