From 112ce82c9a975bee0e453bcb97d6796f8f07429b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 06:19:48 -0800 Subject: [PATCH 01/16] Format and text fixes in 2020/ferguson1/snake.1 --- 2020/ferguson1/snake.1 | 87 ++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/2020/ferguson1/snake.1 b/2020/ferguson1/snake.1 index 273f2f124..1dbff7495 100644 --- a/2020/ferguson1/snake.1 +++ b/2020/ferguson1/snake.1 @@ -4,17 +4,7 @@ snake \- Feature\-rich curses implementation of the classic 'Snake' game with ma .SH SYNOPSIS \fBWAIT\fP=\fIN\fP \fBWALLS\fP=\fI[01]\fP \fBEVADE\fP=\fIN\fP \fBSIZE\fP=\fIN\fP \fBMAXSIZE\fP=\fIN\fP \fBGROW\fP=\fIN\fP \fBSHEDS\fP=\fIN\fP \fBSHED\fP=\fIN\fP \fBCANNIBAL\fP=\fI[01]\fP ./snake .br -# start pressing some arrow keys -.br -where -.I N -is a number and -.I [01] -is either -.I 1 -or -.I 0 -(or more correctly zero and non-zero). +# Start pressing some arrow keys to play .SH DESCRIPTION \fBsnake\fP has two cheat modes (passable walls/self[cannibalism]), a drawing/practising mode, \fIcan play by itself\fP (\fBand win!\fP), is coloured (included \fIsnake-colours.sh\fP and \fIplay.sh\fP scripts compile in player\-selected colours) and there are many other play modes (many more can be devised with the imagination and the environmental variables; see \fBENVIRONMENT\fP and the file \fIgameplay.md\fP for many examples) and options. You can pause and there's even a built\-in test unit for some features! @@ -22,31 +12,31 @@ You can pause and there's even a built\-in test unit for some features! Besides the environmental variables (described below) that create for a lot of gameplay modes, here are some additional features: .PP .RS -\fB\-\fP A drawing mode (\fBWAIT < 0\fP makes \fBtimeout()\fP block). +\fB\(bu\fP A drawing mode (\fBWAIT < 0\fP makes \fBtimeout(3)\fP block). .RE .PP .RS -\fB\-\fP Computer plays the game (\fBWAIT=0\fP) +\fB\(bu\fP Computer plays the game (\fBWAIT=0\fP) \fB(EPILEPSY/STIMULATION OVERLOAD TRIGGER WARNING\fP included in the relevant section of the \fIgameplay.md\fP; this goes for low \fBEVADE\fP values too). .RE .PP .RS -\fB\-\fP Grow\-Shrink (Positive and Negative Winning) mode (see \fIgameplay.md\fP for more details). +\fB\(bu\fP Grow\-Shrink (Positive and Negative Winning) mode (see \fIgameplay.md\fP for more details). .RE .PP .RS -\fB\-\fP Different colours and characters for the bug, snake head, snake and walls: +\fB\(bu\fP Different colours and characters for the bug, snake head, snake and walls: .RS -\fB\-\fP Bug is \fB*\fP (white). +\fB\(bu\fP Bug is \fB*\fP (white). .RE .RS -\fB\-\fP Head is an arrow facing the direction the snake is facing (\fB<\fP, \fB^\fP, \fB>\fP, \fBv\fP) (red). +\fB\(bu\fP Head is an arrow facing the direction the snake is facing (\fB<\fP, \fB^\fP, \fB>\fP, \fBv\fP) (red). .RE .RS -\fB\-\fP Body is \fBo\fP (green). +\fB\(bu\fP Body is \fBo\fP (green). .RE .RS -\fB\-\fP Walls are \fB#\fP (cyan). +\fB\(bu\fP Walls are \fB#\fP (cyan). .RE .RE .SH OPTIONS @@ -56,26 +46,26 @@ The options are specified via the environmental variables. The following environmental variables modify the behaviour of the game: .TP .B WAIT -positive or negative integer that changes how long to wait for a key press prior to moving again. +Positive or negative integer that changes how long to wait for a key press prior to moving again. < 0 blocks which allows for complete control over movement at your own pace. Default 231; you can move faster by holding down or rapidly pressing an arrow key. .TQ .B WALLS -whether the walls are passable or impassable. +Whether the walls are passable or impassable. Default 1, passable; 0 means impassable and you will die if you hit a wall. .TQ .B EVADE -how many movements the Snake makes before the bug (well insect) will move to another location in the field. +How many movements the Snake makes before the bug (well insect) will move to another location in the field. Default 300; 0 disables. .TQ .B SIZE -initial size of the Snake. +Initial size of the Snake. Default 5. Note that it grows by one per move so at the default 5 it will not initially be 5 characters long! < 0 is an immediate win. .TQ .B MAXSIZE -the maximum size the Snake can become before the game is won. +The maximum size the Snake can become before the game is won. < 0 is the maximum size based on terminal dimensions; any other size will be capped based on the terminal dimensions to prevent problems. Note that when .B SIZE + GROW >= MAXSIZE @@ -84,26 +74,24 @@ you win you grow to the full size! .TQ .B GROW -size to grow every time you eat a bug. +Size to grow every time you eat a bug. Default 5; can be negative. "Negativity" creates for fun gameplay modes with enough creativity. -See \fIgameplay.md\fP/\fIgameplay.html\fP for some examples. +See \fB\\fP for some examples. \fIplay.sh\fP allows you to reconfigure the colours and play different pre\-configured gameplay modes. .TQ .B SHED -every +Every .B SHED movements you will grow (> 0), shrink (< 0) or stay the same length (0) by the .B SHEDS (below) value. Default 0. Again with creativity you can create some fun gameplay modes. -NOTE: the concept of shedding in this game is a misnomer. \fB\- Exception\fP: if the bug is eaten the counter isn't incremented. -This is how snakes grow in the wild so is a misnomer here because snakes don't grow in the manner that the original Snake game was designed. .TQ .B SHEDS -every +Every .B SHED movements will impact what this value means: grow (> 0), shrink (< 0) or not at all (0). Default 0. @@ -121,12 +109,14 @@ or See .I play.sh and -.I gameplay.html +.I \ for examples. -\fB\- Exception\fP: if the bug is eaten the counter isn't incremented. -NOTE: the concept of shedding in this game is a misnomer. -\fB\-\fP How many moves (\fBSHED\fP, \fIdefault 0, disabled\fP) before 'stretching' (grow) (\fBSHEDS\fP, \fIdefault 5\fP; can be negative). -This is how snakes grow in the wild so is a misnomer here because snakes don't grow in the manner that the original Snake game was designed. +.sp +.RS +.RS +\fBException\fP: if the bug is eaten the counter isn't incremented. +.RE +.RE .PP The following two modify the terminal dimensions (this is not part of the game but the terminal/curses itself). Elsewhere I document these more and their potential pitfalls. @@ -223,19 +213,23 @@ Other versions I submitted. \fIprog.2.c\fP is the second version; \fIprog.3.c\fP It also clears the screen before playing to try and maintain terminal sanity should you pass the LINES environmental variable to the program. .RE .RE +.SH NOTES +The concept of shedding in this game is a misnomer. +This is how snakes grow in the wild so it is a misnomer here because snakes don't grow in the manner that the original Snake game was designed. .SH BUGS -\fB\-\fP the screen keeps showing bugs! -.br -\fB\-\fP there's no boss screen. -.br -\fB\-\fP it was written by a human being. -.br -\fB\-\fP technically walls, snakeskin and the snake itself would \fBnot\fP be an obstacle in real life. +.PP +The screen keeps showing bugs (that aren't bugs :-) )! +.PP +There's no boss screen. +.PP +It was written by a human being. +.PP +Technically walls, snakeskin and the snake itself would \fBnot\fP be an obstacle in real life. The shed snakeskin is not an obstacle but walls can be and so can the snake itself. Also snakes grow by moulting (technical term for shedding) so when the snake leaves its snakeskin behind it really ought to grow but instead it shrinks; this means negative shedding ought to have the snake grow and positive shedding have the snake - what? It's a misnomer: it took fewer bytes and the negative shedding is a positive consequence of unsigned arithmetic. .PP -On a more serious note see the \fBbugs.md\fP file. +On a more serious note see \fB\\fP. .SH EXAMPLES .PP Test your terminal capabilities and get other various data (based on dimensions of terminal, growth size, size and max size as specified i.e. you can pass in the variables \fBLINES\fP, \fBCOLUMNS\fP, \fBMAXSIZE\fP, \fBGROW\fP and \fBSIZE\fp): @@ -283,9 +277,12 @@ Run script that prompts for the colours to be used, compiles and then runs the g .PP That will compile the game to be the colours you select and then enable cannibalism, set the starting size to 15, max size to 45 and walls are made impassable. .PP -For more gameplay information and modes check \fIgameplay.md\fP; and for an interactive script that prompts for some of those modes see the \fIplay.sh\fP script. +For many more gameplay information, modes and features check: +.br +\fB\\fP +and for an interactive script that prompts for some of those modes see the \fIplay.sh\fP script. .SH AUTHOR Written by Cody Boone Ferguson for IOCCC 2020 (the 27th IOCCC). .SH SEE ALSO .PP -\fB\\fP The 27th IOCCC 'Don't tread on me' award. +\fB\\fP The 27th IOCCC 'Don't tread on me award' winning entry. From 1b751f1434af5f6296c09ad646c928cd341f3578 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 07:45:13 -0800 Subject: [PATCH 02/16] Remove 1988/spinellis/try*sh These were added in error due to the nature of the entry. It might be possible to make them work but it's not ideal so they are now removed. --- 1988/spinellis/try.alt.sh | 31 ------------------------------- 1988/spinellis/try.sh | 27 --------------------------- 2 files changed, 58 deletions(-) delete mode 100755 1988/spinellis/try.alt.sh delete mode 100755 1988/spinellis/try.sh diff --git a/1988/spinellis/try.alt.sh b/1988/spinellis/try.alt.sh deleted file mode 100755 index e7c57fa2c..000000000 --- a/1988/spinellis/try.alt.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# -# try.alt.sh - demonstrate IOCCC winner 1988/spinellis 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 - -# clear screen after compilation so that only the entry is shown -clear - -echo "$ cat input.txt" 1>&2 -cat input.txt - -echo "$ cc -Wno-error spinellis.alt.c -o spinellis.alt && ./spinellis.alt < input.txt" -cc -Wno-error spinellis.alt.c -o spinellis.alt && ./spinellis.alt < input.txt -echo "$ ./spinellis.alt" 1>&2 -./spinellis.alt - -echo 1>&2 - -echo "$ cat input2.txt" 1>&2 -cat input2.txt -echo "$ cc -Wno-error spinellis.c -o spinellis.alt && ./spinellis" 1>&2 -cc -Wno-error spinellis.alt.c -o spinellis.alt && ./spinellis.alt < input2.txt -echo "$ ./spinellis.alt" 1>&2 -./spinellis.alt diff --git a/1988/spinellis/try.sh b/1988/spinellis/try.sh deleted file mode 100755 index 1b6413d33..000000000 --- a/1988/spinellis/try.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# -# try.sh - demonstrate IOCCC winner 1988/spinellis -# - -# 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 - -# clear screen after compilation so that only the entry is shown -clear - -echo "$ cat input.txt" 1>&2 -cat input.txt - -echo "$ cc spinellis.c -o spinellis < input.txt && ./spinellis" 1>&2 -cc spinellis.c -o spinellis < input.txt && ./spinellis - -echo 1>&2 - -echo "$ cat input2.txt" 1>&2 -cat input2.txt -echo "$ cc spinellis.c -o spinellis < input2.txt && ./spinellis" 1>&2 -cc spinellis.c -o spinellis < input2.txt && ./spinellis From 07c4fc231a31f284695be0d655b9970d3f97ee23 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:02:27 -0800 Subject: [PATCH 03/16] Fix paths in thanks file --- thanks-for-help.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thanks-for-help.md b/thanks-for-help.md index e2af75d1f..feb379284 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -2045,7 +2045,7 @@ problem was a missing `int` for the `f` variable. He felt it was even more important that it works because the layout does indeed look to him like a rat is dropping core :-), something that the judges suggested. -Cody also renamed `garry.test.sh` to [try.sh](/1995/garrytry.sh) and improved it +Cody also renamed `garry.test.sh` to [try.sh](/1995/garry/try.sh) and improved it to to make sure the program is compiled before trying to use it as well as adding a few enhancements. For the alt version he also added the [try.alt.sh](/1995/garry/try.alt.sh) script to use the alt version, though the @@ -2918,7 +2918,7 @@ Cody also added the [try.sh](/2001/schweikh/try.sh) script. ## [2001/westley](/2001/westley/westley.c) ([README.md](/2001/westley/README.md])) -[Cody](#cody) added the script [try.sh](try.sh) to automate a heap of commands +[Cody](#cody) added the script [try.sh](2001/westley/try.sh) to automate a heap of commands that we, the IOCCC judges, suggested, as well as some additional ones that he thought would be fun. He also provided the sort and punch card versions, described in the README.md, based on the author's remarks. From 8a9c248d2530a339226bd8aafade224fe98d08be Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:12:50 -0800 Subject: [PATCH 04/16] Add missing try.sh to 1990/baruch/README.md --- 1990/baruch/README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/1990/baruch/README.md b/1990/baruch/README.md index 5e9dd336a..67083c8b4 100644 --- a/1990/baruch/README.md +++ b/1990/baruch/README.md @@ -31,12 +31,9 @@ echo 7 | ./baruch ## Try: ```sh -echo 2 | ./baruch -echo 3 | ./baruch +./try.sh ``` -Why is there no output? - ## Alternate code: From c9122d382941cf61a98894ee0e48de56e20c690b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:17:28 -0800 Subject: [PATCH 05/16] Add missing try.sh to 1992/gson/README.md --- 1992/gson/README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/1992/gson/README.md b/1992/gson/README.md index 6602f4e84..6d23d86a7 100644 --- a/1992/gson/README.md +++ b/1992/gson/README.md @@ -28,8 +28,13 @@ For more detailed information see [1992 gson in bugs.md](/bugs.md#1992-gson). ## Try: -Determine where your system dictionary is located. You may find -it located in one of the following places: +```sh +./try.sh +``` + +This script will determine (or try and determine) where your system dictionary +is located and assuming that it can find one it'll use that. It checks the +following locations though the last one is more ironic: ``` /usr/share/dict/words @@ -38,7 +43,7 @@ it located in one of the following places: /dev/null # <-- for machines with nothing to say ``` -Then using the proper dictionary: +Then using the proper dictionary file it does: ```sh ./ag free software foundation < /usr/share/dict/words @@ -50,6 +55,14 @@ Then using the proper dictionary: ./ag paul e tsongas < /usr/share/dict/words ``` +where `/usr/share/dict/words` is the dictionary file. + +Then it uses the [mkdict.sh](mkdict.sh) script to create a dictionary file out +of the files [README.md](README.md), [try.sh](try.sh) (itself) and +[Makefile](Makefile) and it repeats the same commands as above. In the case no +dictionary file can be found in the first step it only runs the commands once +with the created dictionary file. + ## Judges' remarks: From 8065de25ac34e7dae4df937fdc3837d226bd689f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:20:27 -0800 Subject: [PATCH 06/16] Add missing try.sh to 1992/westley/README.md --- 1992/westley/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/1992/westley/README.md b/1992/westley/README.md index e1a3dd303..997e8ef4e 100644 --- a/1992/westley/README.md +++ b/1992/westley/README.md @@ -23,10 +23,7 @@ If lost: ```sh -./whereami lat long - -# or, if you don't have curses installed: -./westley lat long +./whereami.sh lat long ``` Where `lat` and `long` correspond to your latitude and longitude. @@ -40,12 +37,7 @@ should just use the `westley` and `westley.alt` programs directly. ## Try: ```sh -./whereami 47 -122 # NOTE: - means west of meridian -./whereami 47 122 - -# or if you don't have curses installed: -./westley 47 -122 -./westley 47 122 +./try.sh ``` @@ -64,15 +56,23 @@ make alt ### Alternate use: ```sh -./whereami.alt lat long +./whereami.alt.sh lat long -# or if you don't have curses installed: -./westley.alt lat long ``` NOTE: this alternative version also needs a terminal with at least 80 columns. +### Alternate try: + +The [try.sh](try.sh) script uses both the original entry and the alternate code +so one can try the same script for both: + +```sh +./try.sh +``` + + ## Judges' remarks: To find the approximate place where this entry was judged, type: From 5c01a35d151d4d56e300265c3af3994a6d94357b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:21:04 -0800 Subject: [PATCH 07/16] Add missing try.sh to 2000/dlowe/README.md --- 2000/dlowe/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2000/dlowe/README.md b/2000/dlowe/README.md index bdcd0d946..731e2222b 100644 --- a/2000/dlowe/README.md +++ b/2000/dlowe/README.md @@ -35,7 +35,7 @@ For more detailed information see [2000 dlowe in bugs.md](/bugs.md#2000-dlowe). ## Try: ```sh -echo "13 14 15 16 17 + - * / p" | ./dlowe +./try.sh ``` From cb9d7dbb69de1c08677f8d557ec545f8fe37b45e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:21:37 -0800 Subject: [PATCH 08/16] Typo fix try.sh in 2004/kopczynski/README.md --- 2004/kopczynski/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2004/kopczynski/README.md b/2004/kopczynski/README.md index 20812b414..2ad4a6711 100644 --- a/2004/kopczynski/README.md +++ b/2004/kopczynski/README.md @@ -18,7 +18,7 @@ will not work with it enabled. ## Try: ```sh -./try +./try.sh ``` What happens if you feed the program source to the program? Can you figure out From 66bbe52fef372b4dcbcc96dba598fe7b3310b14e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:24:47 -0800 Subject: [PATCH 09/16] Add missing try.sh to 2005/giljade/README.md I also slightly improved the script. --- 2005/giljade/README.md | 11 +++-------- 2005/giljade/try.sh | 14 +++++++------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/2005/giljade/README.md b/2005/giljade/README.md index 4c378f30f..37e9fd6ac 100644 --- a/2005/giljade/README.md +++ b/2005/giljade/README.md @@ -29,15 +29,8 @@ For more detailed information see [2005 giljade in bugs.md](/bugs.md#2005-giljad ## Try: ```sh -./giljade > out +./try.sh ``` -Open an xterm with 78 lines. - -```sh -vi out -``` - -Press `^F` (control F) repeatedly. ### Self-test feature to try: @@ -47,6 +40,8 @@ Press `^F` (control F) repeatedly. ./giljade out ``` +NOTE: [try.sh](try.sh) will ask you if you wish to do this. + ## Judges' remarks: diff --git a/2005/giljade/try.sh b/2005/giljade/try.sh index 449747284..7f1b40ec4 100755 --- a/2005/giljade/try.sh +++ b/2005/giljade/try.sh @@ -23,19 +23,19 @@ echo 1>&2 ./giljade > out echo 1>&2 echo "For this next step, make sure to keep pressing space (or hold it down) (q = quit)." 1>&2 -read -r -n 1 -p "Press any key to run: less -rEXF out: " -less -rEXF out - +read -r -n 1 -p "Press any key to continue: " echo 1>&2 +less -rEXFK out +echo 1>&2 + echo "We've left the file 'out' for you in case you wish to open it in vi(m). If" 1>&2 echo "you do we recommend you try holding ctrl-f down in a similar way to how you held" 1>&2 echo "down space above. Of course you can open it in another editor if you wish." 1>&2 echo 1>&2 -read -r -p "Do you wish to run the test suite (y/n) ? " +read -r -p "Do you wish to run the test suite (Y/N)? " if [[ "$REPLY" == "y" || "$REPLY" = "Y" ]]; then - echo "$ make test" 1>&2 + read -r -n 1 -p "Press any key to run: make test: " + echo 1>&2 make test fi - - From 1f296f954eada4c2cf37ab320b25b8402b40c631 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:25:50 -0800 Subject: [PATCH 10/16] Add missing try.sh to 2005/timwi/README.md --- 2005/timwi/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2005/timwi/README.md b/2005/timwi/README.md index 31b4fd81c..4a7db0ead 100644 --- a/2005/timwi/README.md +++ b/2005/timwi/README.md @@ -15,7 +15,7 @@ make ## Try: ```sh -(echo "20 : ,-->+.>+.<<[>[>>+>+<<<-]>[>>+>+<<<-]>"; echo "[<+>-]>[<<<+>>>-]>[-]<<<<.<-]") | ./timwi +./try.sh ``` From 16cef0504c2562eb1c78e8788ec58993bce9756f Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:26:42 -0800 Subject: [PATCH 11/16] Fix to use/try in 2011/richards/README.md The alt try script is not mentioned in the README.md file as the alt version is only a starting point for others who might wish to try and fix this entry (as alternate code) for Macs with the Apple chip. The alternate code I added as a starting point but the bugs.md is where the details are. Since the alt code does not actually function properly it shouldn't be referenced in the README.md file. It should only be referenced in the bugs.md which it is (the bugs.md was slightly updated with this too). --- 2011/richards/README.md | 5 ++--- bugs.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/2011/richards/README.md b/2011/richards/README.md index 287f0255b..db4c64269 100644 --- a/2011/richards/README.md +++ b/2011/richards/README.md @@ -18,15 +18,14 @@ For more detailed information see [2011 richards in bugs.md](/bugs.md#2011-richa ## To use: ```sh -./try.sh +echo expression | ./richards ``` ## Try: ```sh -echo '10 9 8 7 6 5 4 3 2 1*p*p*p*p*p*p*p*p*p' | ./richards -echo '64 256 128 p/p*p' | ./richards +./try.sh ``` diff --git a/bugs.md b/bugs.md index 4d2587b67..d95d767a3 100644 --- a/bugs.md +++ b/bugs.md @@ -2872,7 +2872,7 @@ case. ### Testing fixes It might be helpful to use the [try.alt.sh](/2011/richards/try.alt.sh) script to -test that it does not crash. +test that it does not crash and functions properly. ### Resources From e5d20501422b4b2042aef1218987fd378936eaf6 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:31:53 -0800 Subject: [PATCH 12/16] Add missing try.sh to 2012/blakely/README.md --- 2012/blakely/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/2012/blakely/README.md b/2012/blakely/README.md index 2391437f5..f33e5de7d 100644 --- a/2012/blakely/README.md +++ b/2012/blakely/README.md @@ -26,11 +26,7 @@ For more detailed information see [2012 blakely in bugs.md](/bugs.md#2012-blakel ## Try: ```sh -./blakely "xx*yy*+" 64 > paraboloid.gif - -./blakely 9 32 > empty.gif - -time ./blakely 0 250 > flat.gif +./try.sh ``` From 170c142bff3e0ea40fccfb0219ade702a32f0354 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:32:42 -0800 Subject: [PATCH 13/16] Add missing try.sh to 2014/endoh2/README.md --- 2014/endoh2/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/2014/endoh2/README.md b/2014/endoh2/README.md index baa857b9d..1f2ff8058 100644 --- a/2014/endoh2/README.md +++ b/2014/endoh2/README.md @@ -15,11 +15,7 @@ make ## Try: ```sh -echo Hello | ./prog - -echo Hello | ./prog > hello.c -make hello -./hello +./try.sh ``` From e1a0f7ab93126079de7da015a86539d6de1db6d2 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:33:26 -0800 Subject: [PATCH 14/16] Add missing try.alt.sh to 2018/anderson/README.md --- 2018/anderson/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/2018/anderson/README.md b/2018/anderson/README.md index c7a1f30d9..a99f1669f 100644 --- a/2018/anderson/README.md +++ b/2018/anderson/README.md @@ -41,6 +41,13 @@ make alt Use `prog.alt` as you would `prog` above. +### Alternate try: + +```sh +./try.alt.sh +``` + + ## Judges' remarks: With this entry, you won't need to turn your monitor [upside From c9f3d429371e8d40945b2f5f1637b76c23986f0c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:37:35 -0800 Subject: [PATCH 15/16] Add 2018/ciura/try.alt.sh This also fixes the missing reference to try.sh in the README.md file. Using both scripts one can see the problem the alt code has that was fixed by the author. --- 2018/ciura/README.md | 13 +++++++++++-- 2018/ciura/try.alt.sh | 27 +++++++++++++++++++++++++++ thanks-for-help.md | 3 ++- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 2018/ciura/try.alt.sh diff --git a/2018/ciura/README.md b/2018/ciura/README.md index 5cc430d9f..dfae12eaa 100644 --- a/2018/ciura/README.md +++ b/2018/ciura/README.md @@ -19,8 +19,7 @@ below for more details. ## Try: ```sh -./prog < Makefile -./prog < README.md +./try.sh ``` @@ -43,6 +42,16 @@ make alt Use `prog.alt` as you would `prog` above. +### Alternate try: + +```sh +./try.alt.sh +``` + +Do you spot the fix by running both [try.sh](try.sh) and +[try.alt.sh](try.alt.sh)? + + ## Judges' remarks: This text was processed by `prog`. You may get confused. We're not really sure: diff --git a/2018/ciura/try.alt.sh b/2018/ciura/try.alt.sh new file mode 100755 index 000000000..1b731011e --- /dev/null +++ b/2018/ciura/try.alt.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# try.alt.sh - demonstrate IOCCC winner 2018/ciura 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" alt >/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: ./prog.alt < Makefile: " +echo 1>&2 +./prog.alt < Makefile +echo 1>&2 + +read -r -n 1 -p "Press any key to run: ./prog.alt < README.md: " +echo 1>&2 +./prog.alt < README.md + +exit 0 diff --git a/thanks-for-help.md b/thanks-for-help.md index feb379284..2344f7401 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -4417,7 +4417,8 @@ Finally Cody added the [try.sh](/2018/burton2/try.sh) script. ## [2018/ciura](/2018/ciura/prog.c) ([README.md](/2018/ciura/README.md)) -[Cody](#cody) added the [try.sh](/2018/ciura/try.sh) script and the PDF file, +[Cody](#cody) added the [try.sh](/2018/ciura/try.sh) and +[try.alt.sh](/2018/ciura/try.alt.sh) scripts and the PDF file, [lexicon.pdf](/2018/ciura/lexicon.pdf), that was a dead link, restored from the Internet Wayback Machine. From a34a8e7069427ea916fb6cd78e0898ff06af1e1c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:39:35 -0800 Subject: [PATCH 16/16] Remove completed try related task in todo file --- tmp/things-todo.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tmp/things-todo.md b/tmp/things-todo.md index 2f69f8fff..9d4f0d8c2 100644 --- a/tmp/things-todo.md +++ b/tmp/things-todo.md @@ -1,5 +1,5 @@ # A todo list of known things to check and/or do -*Last updated: Thu 01 Feb 2024 16:10:23 UTC* +*Last updated: Fri 02 Feb 2024 16:39:08 UTC* This document is for [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) as he (that is I :-) ) wanted a way to keep track of things in a way that did not @@ -36,9 +36,6 @@ embedded into the README.md files themselves. An entry that the video file is downloaded already is 2006/sykes1. There are others that I need to look at once the rest of the entries are done, assuming that it's possible. -- Verify that all entries that have a try or try.alt script actually refer to it -in the README.md try and alternate try sections. - - Test and fix as and if necessary 2018/ferguson/weasel.spec. - Update formatting in 2020/ferguson[12]/chocolate-cake.md specifically with