diff --git a/2006/toledo1/README.md b/2006/toledo1/README.md index ab0d9f656..62def63d2 100644 --- a/2006/toledo1/README.md +++ b/2006/toledo1/README.md @@ -17,9 +17,7 @@ where `[0-9][0-9]` is a two digit number. ### Try: ```sh -./toledo1 00 -./toledo1 30 -./toledo1 99 +./try.sh ``` @@ -49,7 +47,7 @@ giving initial position. ``` It will print move order. The algorithm is so simple that you can read -it on the source code. At the first glance it can appear checkered. +it in the source code. At the first glance it can appear checkered. Nevertheless, don't be dismayed, jar, jar. :-) diff --git a/2006/toledo1/try.sh b/2006/toledo1/try.sh new file mode 100755 index 000000000..a1d874c6a --- /dev/null +++ b/2006/toledo1/try.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2006/toledo1 +# + +# 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: ./toledo1 00: " +./toledo1 00 + +read -r -n 1 -p "Press any key to run: ./toledo1 30: " +./toledo1 30 + +read -r -n 1 -p "Press any key to run: ./toledo1 99: " +./toledo1 99 + +read -r -n 1 -p "Press any key to run: ./toledo1 42: " +./toledo1 42 + +read -r -n 1 -p "Press any key to run: ./toledo1 11 # start is A8: " +./toledo1 11 # start is A8 + +read -r -n 1 -p "Press any key to run: ./toledo1 18 # start is H8: " +./toledo1 18 # start is H8 + +read -r -n 1 -p "Press any key to run: ./toledo1 81 # start is A1: " +./toledo1 81 # start is A1 + +read -r -n 1 -p "Press any key to run: ./toledo1 88 # start is H1: " +./toledo1 88 # start is H1 + +read -r -n 1 -p "Press any key to run: ./toledo1 44 # start is D5: " +./toledo1 44 # start is D5 + +echo "What happened with the last ones?" 1>&2 diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index edf81ff7a..2d256770b 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3047,6 +3047,11 @@ Cody also added the [try.sh](2006/sykes2/try.sh) script for easier use of the entry to show the clock update in real time. +## [2006/toledo1](2006/toledo1/toledo1.c) ([README.md](2006/toledo1/README.md])) + +Cody added the [try.sh](2006/toledo1/try.sh) script. + + ## [2006/toledo2](2006/toledo2/toledo2.c) ([README.md](2006/toledo2/README.md])) Cody fixed a segfault in this program which was making it fail to work under