Add 2006/toledo1/try.sh + format/typo checks
This commit is contained in:
1 parent
3cfbcd7b38
commit
d2daca0216
3 files changed
+53
-4
No files matched your search
@@ -17,9 +17,7 @@ where `[0-9][0-9]` is a two digit number.
|
|||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./toledo1 00
|
./try.sh
|
||||||
./toledo1 30
|
|
||||||
./toledo1 99
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +47,7 @@ giving initial position.
|
|||||||
```
|
```
|
||||||
|
|
||||||
It will print move order. The algorithm is so simple that you can read
|
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. :-)
|
Nevertheless, don't be dismayed, jar, jar. :-)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable
+46
@@ -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
|
||||||
@@ -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.
|
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]))
|
## [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
|
Cody fixed a segfault in this program which was making it fail to work under
|
||||||
|
|||||||
Reference in new issue
Block a user