Add 2013/cable1/try.sh + format/typo checks

Rather than link to twitter.com there is a new image of the tweet
(screenshot).

The try.sh has a joke Easter egg in it based on said tweet.

Format/typo check README.md file.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-03 09:28:16 -08:00
1 parent a441c47ec0
commit 39cb779c19
4 files changed
+66 -6

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2013/cable1
#
# 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: ./cable1 obama republican democrat: "
echo 1>&2
./cable1 obama republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 nixon republican democrat: "
echo 1>&2
./cable1 nixon republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 bush republican democrat: "
echo 1>&2
./cable1 bush republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 kennedy republican democrat: "
echo 1>&2
./cable1 kennedy republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 lincoln republican democrat: "
echo 1>&2
./cable1 lincoln republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 roosevelt republican democrat: "
echo 1>&2
./cable1 roosevelt republican democrat
echo 1>&2
read -r -n 1 -p "Press any key to run: ./cable1 fdr republican democrat: "
echo 1>&2
./cable1 fdr republican democrat
echo 1>&2
read -r -n 1 -p "Press any key: ./cable1 microsoft alive dead: "
echo 1>&2
./cable1 microsoft alive dead
echo 1>&2