Add 2013/morgan1/try.sh
This commit is contained in:
1 parent
b156b37ef0
commit
d4783f02e7
3 files changed
+43
-8
No files matched your search
@@ -8,20 +8,17 @@ make
|
|||||||
## To use:
|
## To use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo "2013/10/03" | ./morgan1
|
echo "YYYY/MM/DD" | ./morgan1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
where `YYYY` is the four digit year, `MM` is the two digit month and `DD` is two
|
||||||
|
digit day of the month.
|
||||||
|
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo "1985/10/28" | ./morgan1
|
./try.sh
|
||||||
|
|
||||||
echo "1996/12/31" | ./morgan1
|
|
||||||
|
|
||||||
echo "1986/03/31" | ./morgan1 # Comet Halley (look for 'Ha')
|
|
||||||
|
|
||||||
echo "1997/04/01" | ./morgan1 # Comet Hale-Bopp (look for 'Hb')
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Try pressing the arrow keys when your focus is in the window.
|
Try pressing the arrow keys when your focus is in the window.
|
||||||
|
|||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2013/morgan1
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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: echo 1985/10/28 | ./morgan1: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "1985/10/28" | ./morgan1
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo 1996/12/31 | ./morgan1: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "1996/12/31" | ./morgan1
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo 1986/03/31 | ./morgan1 # Comet Halley (look for 'Ha'): "
|
||||||
|
echo 1>&2
|
||||||
|
echo "1986/03/31" | ./morgan1 # Comet Halley (look for 'Ha')
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo 1997/04/01 | ./morgan1 # Comet Hale-Bopp (look for 'Hb'): "
|
||||||
|
echo 1>&2
|
||||||
|
echo "1997/04/01" | ./morgan1 # Comet Hale-Bopp (look for 'Hb')
|
||||||
|
echo 1>&2
|
||||||
@@ -4052,6 +4052,8 @@ Firefox both had the problem.
|
|||||||
[Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this
|
[Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this
|
||||||
implicitly (Linux doesn't seem to but macOS does).
|
implicitly (Linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
Cody also added the [try.sh](/2013/morgan1/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2013_robison"></a>[2013/robison](/2013/robison/robison.c) ([README.md](/2013/robison/README.md))
|
## <a name="2013_robison"></a>[2013/robison](/2013/robison/robison.c) ([README.md](/2013/robison/README.md))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user