Add try scripts to 2018/ferguson + formatting

The try.sh and try.alt.sh scripts are respectively for the entry and the
alt code. There is a joke in them that is based on what the judges
originally suggested one try.

The weasel.man page was deleted. Instead weasel.1 has had the FILES
section removed (which caused some confusion in another way with
another winner of that year). The spec file will have to be tested again
another time.

I did NOT format / typo check the README.md file. Too much to do for now
and since it's mine I can do it any other time. I'd like to get through
the rest of the entries.

Thus this should complete (for now?) 2018/ferguson.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-11 06:43:51 -08:00
1 parent a3eb5340d7
commit 70bb65f47e
9 files changed
+137 -253

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2018/ferguson
#
# 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: ./weasel words (space = next page, q = quit): "
echo 1>&2
time ./weasel words | less -EXF
read -r -n 1 -p "Press any key to see how long it'll take Eric the monkey to type his name: "
echo 1>&2
time ./weasel -mq Eric
echo 1>&2
read -r -n 1 -p "Press any key to run: make test: "
echo 1>&2
make test
read -r -p "Do you wish to try and prove 'intelligent design' (Y/N)? "
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
echo "$ ./weasel -m 'INTELLIGENT DESIGN'" 1>&2
echo "Press any key to continue. Send ctrl-c when convinced that intelligent" 1>&2
read -r -n 1 -p "design is not real or you're tired of waiting: "
echo 1>&2
time ./weasel -m 'INTELLIGENT DESIGN'
echo 1>&2
else
echo "$ ./weasel -q -r8 'EVOLUTION IS A PROVEN FACT'" 1>&2
time ./weasel -q -r8 'EVOLUTION IS A PROVEN FACT'
fi
read -r -n 1 -p "Do you want to see how long it might take the monkey Eric to type 'words'? (Y/N)? "
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
echo 1>&2
echo "Will not display until Eric succeeds or too many generations. Hit ctrl-c" 1>&2
echo "to stop him early." 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
time ./weasel -mq words
fi