diff --git a/1994/horton/README.md b/1994/horton/README.md index 59d9d6b0d..ce3021a44 100644 --- a/1994/horton/README.md +++ b/1994/horton/README.md @@ -17,13 +17,7 @@ make all ## Try: ```sh -./horton 3 2 1 0 -``` - -Also try: - -```sh -./gtface < gtface.data +./try.sh ``` @@ -46,14 +40,25 @@ make alt ./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: Try to figure out how this program prints, for a given slope, the 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: @@ -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 class. + ### SPOILER: As should be obvious from 20 feet away, the program is a cubic plotter. @@ -79,10 +85,10 @@ make gtface ./gtface < gtface.data ``` -For more information, see +For more information, see my article -Using GraphTab; USENIX ;login: -Sept/Oct 1992; Pages 28-31 +[Using GraphTab; USENIX ;login: Sept/Oct 1992](login_sept92.pdf), [pages +28-31](login_sept92-pp28-31.pdf). ``` diff --git a/1994/horton/login_sept92-pp28-31.pdf b/1994/horton/login_sept92-pp28-31.pdf new file mode 100644 index 000000000..c423b6b14 Binary files /dev/null and b/1994/horton/login_sept92-pp28-31.pdf differ diff --git a/1994/horton/login_sept92.pdf b/1994/horton/login_sept92.pdf new file mode 100644 index 000000000..e1b9d2490 Binary files /dev/null and b/1994/horton/login_sept92.pdf differ diff --git a/1994/horton/try.alt.sh b/1994/horton/try.alt.sh new file mode 100755 index 000000000..dcc7f50f4 --- /dev/null +++ b/1994/horton/try.alt.sh @@ -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 diff --git a/1994/horton/try.sh b/1994/horton/try.sh new file mode 100755 index 000000000..ee836bd12 --- /dev/null +++ b/1994/horton/try.sh @@ -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 diff --git a/thanks-for-help.md b/thanks-for-help.md index 7858e3128..3b4a03104 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -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 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 -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. Cody also fixed the Makefile which was causing alt code to be compiled when it 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). + ## [1994/ldb](/1994/ldb/ldb.c) ([README.md](/1994/ldb/README.md]))