Add 2020/endoh2/try.sh + format/typo checks

This commit is contained in:
Cody Boone Ferguson committed 2023-12-21 12:02:03 -08:00
1 parent 769962f389
commit 3cddfbcb33
3 files changed
+62 -9

No files matched your search

+9 -7
View File
@@ -15,15 +15,17 @@ make
### Try:
```sh
./prog
./prog hello.txt
./prog yoda.txt
./prog bear.txt
./try.sh
```
What happens if you do
```sh
./prog prog.c
```
?
## Judges' remarks:
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2020/endoh2
#
# 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: ./prog: "
echo 1>&2
./prog
echo 1>&2
read -r -n 1 -p "Press any key to show hello.txt: "
echo 1>&2
cat hello.txt
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog hello.txt: "
echo 1>&2
./prog hello.txt
echo 1>&2
read -r -n 1 -p "Press any key to show yoda.txt: "
echo 1>&2
cat yoda.txt
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog yoda.txt: "
echo 1>&2
./prog yoda.txt
read -r -n 1 -p "Press any key to show bear.txt: "
echo 1>&2
cat bear.txt
read -r -n 1 -p "Press any key to run: ./prog bear.txt: "
echo 1>&2
./prog bear.txt
+5 -2
View File
@@ -4306,8 +4306,11 @@ a friend, whether that's real or imagined.
## <a name="2020_endoh2"></a>[2020/endoh2](/2020/endoh2/prog.c) ([README.md](/2020/endoh2/README.md))
[Cody](#cody) copied the files from the spoiler.zip file that was password protected with
a password that was no longer known from his preview of 2020.
[Cody](#cody) copied the files from the spoiler.zip file (from his copy during
the preview period) that was password protected with a password that was no
longer known.
He also added the [try.sh](/2020/endoh2/try.sh) script.
## <a name="2020_endoh3"></a>[2020/endoh3](/2020/endoh3/prog.c) ([README.md](/2020/endoh3/README.md))