Rename test scripts in 1995/garry to try
This is to match the other entries (they also run more than one command now).
This commit is contained in:
1 parent
aabb60668a
commit
6eed1e8044
6 files changed
+68
-37
No files matched your search
@@ -15,9 +15,7 @@ make all
|
|||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./garry.test.sh
|
./try.sh
|
||||||
|
|
||||||
./garry < README.md
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -46,9 +44,7 @@ make alt
|
|||||||
### Alternate try:
|
### Alternate try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
GARRY=garry.alt ./garry.test.sh
|
./try.alt.sh
|
||||||
|
|
||||||
./garry.alt < README.md
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
# garry.alt.test.sh - example of how to use garry.alt
|
|
||||||
|
|
||||||
EXAMPLEON="\33\133\61\73\67\155"
|
|
||||||
EXAMPLEOFF="\33\133\155"
|
|
||||||
DOLLAR="$"
|
|
||||||
export EXAMPLEON EXAMPLEOFF DOLLAR
|
|
||||||
|
|
||||||
# make sure alt code is built, first
|
|
||||||
make alt || exit 1
|
|
||||||
|
|
||||||
./garry.alt <garry.data
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
# garry.test.sh - example of how to use garry
|
|
||||||
|
|
||||||
EXAMPLEON="\33\133\61\73\67\155"
|
|
||||||
EXAMPLEOFF="\33\133\155"
|
|
||||||
DOLLAR="$"
|
|
||||||
export EXAMPLEON EXAMPLEOFF DOLLAR
|
|
||||||
|
|
||||||
# make sure code is built, first
|
|
||||||
make all || exit 1
|
|
||||||
|
|
||||||
./garry <garry.data
|
|
||||||
Executable
+30
@@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
#
|
||||||
|
# try.alt.sh - demonstrate IOCCC winner 1995/garry 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
|
||||||
|
|
||||||
|
echo "$ EXAMPLEON=\"\33\133\61\73\67\155\"; EXAMPLEOFF=\"\33\133\155\"; DOLLAR=\"$\"" 1>&2
|
||||||
|
EXAMPLEON="\33\133\61\73\67\155"
|
||||||
|
EXAMPLEOFF="\33\133\155"
|
||||||
|
DOLLAR="$"
|
||||||
|
export EXAMPLEON EXAMPLEOFF DOLLAR
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./garry.alt < garry.data | less (q = quit, space = next page): "
|
||||||
|
|
||||||
|
./garry.alt <garry.data | less -r -X
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./garry.alt < README.md | less (q = quit, space = next page): "
|
||||||
|
./garry.alt < README.md | less -X
|
||||||
Executable
+31
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 1995/garry
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
echo "$ EXAMPLEON=\"\33\133\61\73\67\155\"; EXAMPLEOFF=\"\33\133\155\"; DOLLAR=\"$\"" 1>&2
|
||||||
|
EXAMPLEON="\33\133\61\73\67\155"
|
||||||
|
EXAMPLEOFF="\33\133\155"
|
||||||
|
DOLLAR="$"
|
||||||
|
export EXAMPLEON EXAMPLEOFF DOLLAR
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./garry < garry.data | less (q = quit, space = next page): "
|
||||||
|
|
||||||
|
./garry <garry.data | less -r -X
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./garry < README.md | less (q = quit, space = next page): "
|
||||||
|
./garry < README.md | less -X
|
||||||
+5
-5
@@ -1834,15 +1834,15 @@ 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
|
important that it works because the layout does indeed look to him like a rat is
|
||||||
dropping core :-), something that the judges suggested.
|
dropping core :-), something that the judges suggested.
|
||||||
|
|
||||||
Cody also improved the script [garry.test.sh](1995/garry/garry.test.sh) to make
|
Cody also renamed `garry.test.sh` to [try.sh](1995/garrytry.sh) and improved it
|
||||||
sure the program is compiled before trying to use it and he also added the
|
to to make sure the program is compiled before trying to use it and he also
|
||||||
[garry.alt.test.sh](1995/garry/garry.alt.test.sh) script to use the alt version,
|
added the [try.alt.sh](1995/garry/try.alt.sh) script to use the alt version,
|
||||||
though the alt version is not as important as alt code in other entries.
|
though the alt version is not as important as alt code in other entries.
|
||||||
|
|
||||||
The reason the alt script was added rather than using an environmental variable
|
The reason the alt script was added rather than using an environmental variable
|
||||||
to specify which one to use is to make it easier on the user as typing
|
to specify which one to use is to make it easier on the user as typing
|
||||||
`GARRY=garry.alt ./garry.test.sh` is not as simple (even though simple) as just
|
`GARRY=garry.alt ./try.sh` is not as simple (even though simple) as just
|
||||||
running `./garry.alt.test.sh`.
|
running `./try.alt.sh`.
|
||||||
|
|
||||||
|
|
||||||
## [1995/leo](1995/leo/leo.c) ([README.md](1995/leo/README.md]))
|
## [1995/leo](1995/leo/leo.c) ([README.md](1995/leo/README.md]))
|
||||||
|
|||||||
Reference in new issue
Block a user