Add 1993/dgibson/try.sh
This commit is contained in:
1 parent
d347b24626
commit
58195f6192
4 files changed
+35
-5
No files matched your search
@@ -19,7 +19,7 @@ where:
|
|||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./dgibson.sh dgibson.data3
|
./try.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +38,8 @@ There are a number of data files available:
|
|||||||
- [dgibson.data5](dgibson.data5)
|
- [dgibson.data5](dgibson.data5)
|
||||||
|
|
||||||
For [dgibson.data5](dgibson.data5) you will need a large screen, lots of virtual
|
For [dgibson.data5](dgibson.data5) you will need a large screen, lots of virtual
|
||||||
memory and lots of time!
|
memory and lots of time! The [try.sh](try.sh) script will run
|
||||||
|
[dgibson.sh](dgibson.sh) on all the data files.
|
||||||
|
|
||||||
Good luck trying to use a debugger on this entry! Life is not
|
Good luck trying to use a debugger on this entry! Life is not
|
||||||
always pretty.
|
always pretty.
|
||||||
|
|||||||
+10
-2
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# dgibson.sh - run the dgibson entry
|
# dgibson.sh - run the IOCCC winner 1993/dgibson
|
||||||
#
|
#
|
||||||
# usage:
|
# usage:
|
||||||
# dgibson.sh [data_file]
|
# dgibson.sh [data_file]
|
||||||
@@ -45,7 +45,15 @@ fi
|
|||||||
# build a new copy of the program
|
# build a new copy of the program
|
||||||
#
|
#
|
||||||
rm -f dgibson
|
rm -f dgibson
|
||||||
make dgibson
|
# 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
|
||||||
|
|
||||||
|
|
||||||
# form the next generation
|
# form the next generation
|
||||||
#
|
#
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 1993/dgibson
|
||||||
|
#
|
||||||
|
|
||||||
|
# we make use of the script dgibson.sh so we don't need to compile it. In any
|
||||||
|
# event that script rebuilds the program.
|
||||||
|
if [[ -z "$CC" ]]; then
|
||||||
|
CC="cc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for f in dgibson.data[1-5]; do
|
||||||
|
read -r -n 1 -p "Press any key to run: CC=$CC ./dgibson.sh $f: "
|
||||||
|
echo 1>&2
|
||||||
|
CC="$CC" ./dgibson.sh "$f"
|
||||||
|
echo 1>&2
|
||||||
|
done
|
||||||
+5
-1
@@ -1713,7 +1713,11 @@ first.
|
|||||||
|
|
||||||
## <a name="1993_dgibson"></a>[1993/dgibson](/1993/dgibson/dgibson.c) ([README.md](/1993/dgibson/README.md]))
|
## <a name="1993_dgibson"></a>[1993/dgibson](/1993/dgibson/dgibson.c) ([README.md](/1993/dgibson/README.md]))
|
||||||
|
|
||||||
[Cody](#cody) fixed the script to work which assumed that `.` is in the path.
|
[Cody](#cody) fixed the [dgibson.sh](/1993/dgibson/dgibson.sh) script to work
|
||||||
|
which assumed that `.` is in the path.
|
||||||
|
|
||||||
|
Cody also added the [try.sh](/1993/dgibson/try.sh) script which runs the above
|
||||||
|
mentioned script on all the data files.
|
||||||
|
|
||||||
|
|
||||||
## <a name="1993_ejb"></a>[1993/ejb](/1993/ejb/ejb.c) ([README.md](/1993/ejb/README.md]))
|
## <a name="1993_ejb"></a>[1993/ejb](/1993/ejb/ejb.c) ([README.md](/1993/ejb/README.md]))
|
||||||
|
|||||||
Reference in new issue
Block a user