Add 1991/brnstnd/try.sh and try.txt
The try.txt is a file for the rot13 SORTA file. All but one of the sorta.* files is used. The only one that is not prints out a verr long line of output and would flood the screen. The try section in the README.md does suggest one try it just to be complete.
This commit is contained in:
1 parent
2f76ad3c8e
commit
e0b6a7f357
4 files changed
+66
-4
No files matched your search
@@ -8,11 +8,10 @@ make all
|
||||
### Try:
|
||||
|
||||
```sh
|
||||
./brnstnd < sorta.i2+2
|
||||
./brnstnd < sorta.iwhosort
|
||||
```
|
||||
./try.sh
|
||||
|
||||
See also the other `sorta.*` files.
|
||||
./sorta < sorta.itailrec
|
||||
```
|
||||
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 1991/brnstnd
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
sorta_with_arg()
|
||||
{
|
||||
if [[ "$#" != 2 ]]; then
|
||||
echo "$0: sorta_with_arg() expects a file and arg, only got file name" 1>&2
|
||||
return
|
||||
fi
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./sorta < $1 $2: "
|
||||
echo 1>&2
|
||||
./sorta < "$1" "$2"
|
||||
echo 1>&2
|
||||
}
|
||||
|
||||
sorta()
|
||||
{
|
||||
if [[ "$#" != 1 ]]; then
|
||||
echo "$0: sorta() expects 1 arg, got: $#" 1>&2
|
||||
return
|
||||
fi
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./sorta < $1: "
|
||||
echo 1>&2
|
||||
./sorta < "$1"
|
||||
echo 1>&2
|
||||
}
|
||||
|
||||
sorta sorta.i2+2
|
||||
sorta sorta.icalc
|
||||
sorta_with_arg sorta.iecho "IOCCC 1991/brnstnd"
|
||||
sorta sorta.ifact2
|
||||
sorta sorta.iio
|
||||
sorta sorta.isleep
|
||||
sorta sorta.iwhosort
|
||||
sorta sorta.iarg0
|
||||
sorta sorta.idup
|
||||
sorta sorta.ifact1
|
||||
sorta sorta.ifact3
|
||||
read -r -n 1 -p "Press any key to show try.txt: "
|
||||
echo 1>&2
|
||||
cat try.txt
|
||||
echo 1>&2
|
||||
sorta_with_arg sorta.irot13 try.txt
|
||||
@@ -0,0 +1 @@
|
||||
The quick brown fox jumps over the lazy dog.
|
||||
@@ -1177,6 +1177,9 @@ invalid operands to binary expressions were resolved with the comma operator.
|
||||
Later on, Cody added back the macro `#define D define` to make it look ever so
|
||||
slightly more like the original, even though it's unused.
|
||||
|
||||
Cody also added the [try.sh](/1991/brnstnd/try.sh) script and
|
||||
[try.txt](/1991/brnstnd/try.txt) which the script uses.
|
||||
|
||||
|
||||
## <a name="1991_buzzard"></a>[1991/buzzard](/1991/buzzard/buzzard.c) ([README.md](/1991/buzzard/README.md]))
|
||||
|
||||
|
||||
Reference in new issue
Block a user