Add 1994/horton/try scripts and article cited

The try.sh and try.alt.sh scripts correspond to the original entry and
the alt code (which is enhanced).

The PDF files might need a bit more explaining. The author wrote an
article in 'The USENIX Association Newsletter ;login: September /
October 1992 Vol. 17, No. 5' (the exact title from the PDF) called
'Using GraphTab'. I found the full newsletter in the Internet Wayback
Machine which is now added to the repo (okay: the newsletter as a PDF is
added to the repo, not the Internet Wayback Machine :-) ). But the pages
cited are 28-31 so I extracted (with macOS Preview app: File -> Print
option) the specific pages so one need not look at the full newsletter
if they do not wish to. It felt better to have the PDF rather than
images as it's easier to deal with what the right size is: the size is
there and one can zoom in or out as they see fit (whereas with images
different resolutions make it easier or harder to see what is in them).
This commit is contained in:
Cody Boone Ferguson committed 2024-01-16 05:39:00 -08:00
1 parent c15eacbad7
commit 5c9d422000
6 files changed
+191 -13

No files matched your search

+18 -12
View File
@@ -17,13 +17,7 @@ make all
## Try: ## Try:
```sh ```sh
./horton 3 2 1 0 ./try.sh
```
Also try:
```sh
./gtface < gtface.data
``` ```
@@ -46,14 +40,25 @@ make alt
./horton.alt A B C D ./horton.alt A B C D
``` ```
Where A, B, C and D are like with `horton`. Where A, B, C and D are numbers like with `horton`.
### Alternate try:
```sh
./try.alt.sh
```
## Judges' remarks: ## Judges' remarks:
Try to figure out how this program prints, for a given slope, the Try to figure out how this program prints, for a given slope, the
right character. And for extra credit, try to figure out which right character. And for extra credit, try to figure out which
character is at the bottom on this hint file. :-) character is at the bottom of this hint file. :-)
You might be interested in the author's article that they cite towards the end
of their remarks, included as PDF files for your convenience, the full
newsletter and a PDF file of just the pages cited.
## Author's remarks: ## Author's remarks:
@@ -62,6 +67,7 @@ Run it with any 4 numeric arguments, e.g. `./horton 3 2 1 0`. Play with the
numbers to get a pleasing result, or use it for your high school algebra numbers to get a pleasing result, or use it for your high school algebra
class. class.
### SPOILER: ### SPOILER:
As should be obvious from 20 feet away, the program is a cubic plotter. As should be obvious from 20 feet away, the program is a cubic plotter.
@@ -79,10 +85,10 @@ make gtface
./gtface < gtface.data ./gtface < gtface.data
``` ```
For more information, see For more information, see my article
Using GraphTab; USENIX ;login: [Using GraphTab; USENIX ;login: Sept/Oct 1992](login_sept92.pdf), [pages
Sept/Oct 1992; Pages 28-31 28-31](login_sept92-pp28-31.pdf).
``` ```
Binary file not shown.
Binary file not shown.
+80
View File
@@ -0,0 +1,80 @@
#!/usr/bin/env bash
#
# try.alt.sh - demonstrate IOCCC winner 1994/horton alt code
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: ./horton.alt 3 2 1 0: "
echo 1>&2
./horton.alt 3 2 1 0
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt 0 1 2 3: "
echo 1>&2
./horton.alt 0 1 2 3
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt -1 -2 -4 -8: "
echo 1>&2
./horton.alt -1 -2 -4 -8
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt -8 -4 -2 -1: "
echo 1>&2
./horton.alt -8 -4 -2 -1
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt 42 -42 42 -42: "
echo 1>&2
./horton.alt 42 -42 42 -42
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt -42 42 -42 42: "
echo 1>&2
./horton.alt -42 42 -42 42
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt 100 -100 -200 200: "
echo 1>&2
./horton.alt 100 -100 -200 200
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt -100 100 200 -200: "
echo 1>&2
./horton.alt -100 100 200 -200
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt -4 4 -4 4: "
echo 1>&2
./horton.alt -4 4 -4 4
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton.alt 4 -4 4 -4: "
echo 1>&2
./horton.alt 4 -4 4 -4
echo 1>&2
read -r -n 1 -p "Press any key to show gtface.c (space = next page, q = quit): "
echo 1>&2
less -rEXF gtface.c
echo 1>&2
read -r -n 1 -p "Press any key to show gtface.data (space = next page, q = quit): "
echo 1>&2
less -rEXF gtface.data
echo 1>&2
read -r -n 1 -p "Press any key to run: ./gtface < gtface.data: "
echo 1>&2
./gtface < gtface.data
echo 1>&2
+81
View File
@@ -0,0 +1,81 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 1994/horton
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: ./horton 3 2 1 0: "
echo 1>&2
./horton 3 2 1 0
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton 0 1 2 3: "
echo 1>&2
./horton 0 1 2 3
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton -1 -2 -4 -8: "
echo 1>&2
./horton -1 -2 -4 -8
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton -8 -4 -2 -1: "
echo 1>&2
./horton -8 -4 -2 -1
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton 42 -42 42 -42: "
echo 1>&2
./horton 42 -42 42 -42
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton -42 42 -42 42: "
echo 1>&2
./horton -42 42 -42 42
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton 100 -100 -200 200: "
echo 1>&2
./horton 100 -100 -200 200
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton -100 100 200 -200: "
echo 1>&2
./horton -100 100 200 -200
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton -4 4 -4 4: "
echo 1>&2
./horton -4 4 -4 4
echo 1>&2
read -r -n 1 -p "Press any key to run: ./horton 4 -4 4 -4: "
echo 1>&2
./horton 4 -4 4 -4
echo 1>&2
read -r -n 1 -p "Press any key to show gtface.c (space = next page, q = quit): "
echo 1>&2
less -rEXF gtface.c
echo 1>&2
read -r -n 1 -p "Press any key to show gtface.data (space = next page, q = quit): "
echo 1>&2
less -rEXF gtface.data
echo 1>&2
read -r -n 1 -p "Press any key to run: ./gtface < gtface.data: "
echo 1>&2
./gtface < gtface.data
echo 1>&2
+12 -1
View File
@@ -1872,12 +1872,23 @@ that already existed, how many you had and how many were stolen.
[Cody](#cody) fixed this to check that four args were specified. With the use of the C [Cody](#cody) fixed this to check that four args were specified. With the use of the C
pre-processor macro and inclusion of `stdlib.h` in the Makefile the layout of the pre-processor macro and inclusion of `stdlib.h` in the Makefile the layout of the
source is exactly the same column width and no additional lines were added. This source is exactly the same column width and no additional lines were added. This
was done during one of the times where this was changed to bug status, for was done during one of the times where this was changed to bug to fix status, for
better or worse. better or worse.
Cody also fixed the Makefile which was causing alt code to be compiled when it Cody also fixed the Makefile which was causing alt code to be compiled when it
shouldn't be. shouldn't be.
Cody also added the scripts [try.sh](/1994/horton/try.sh) and
[try.alt.sh](/1994/horton/try.alt.sh).
Finally he added the article (written by the entry's author) cited in the
remarks: the full [USENIX Association Newsletter ;login: September / October
1992 Vol. 17, No. 5](/1994/horton/login_sept92.pdf) and the pages cited as a
shorter PDF file,
[login_sept92-pp28-31.pdf](/1994/horton/login_sept92-pp28-31.pdf). The full
newsletter was found on the Internet Wayback Machine and the article was
extracted as a PDF in the macOS `Preview.app` (`File -> Print` feature).
## <a name="1994_ldb"></a>[1994/ldb](/1994/ldb/ldb.c) ([README.md](/1994/ldb/README.md])) ## <a name="1994_ldb"></a>[1994/ldb](/1994/ldb/ldb.c) ([README.md](/1994/ldb/README.md]))