2012/endoh2/everything.sh -> try.sh and formatting

To make the script more like the other entries I renamed the script I
originally named everything.sh (because there's so much it does and it
uses 'make everything') to try.sh.

The README.md file has been format and typo checked.

This should complete the review of 2012/endoh2.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-02 09:26:28 -08:00
1 parent c9503446e4
commit 41dd7d842d
4 files changed
+60 -42

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2000/tomx
#
# 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" everything >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
run()
{
local program="$1"
echo "" 1>&2
read -r -n 1 -p "Press any key to run: ./${program} (space = next page, q = quit): "
"./${program}" | less -K -E -X
}
run pi
run 314
run 3141
run 31415
run 314159
run 3141592
run 31415926
run 314159265
run 3141592653
run 31415926535
run e 271
run 2718
run 27182
run 271828
run 2718281
run 27182818
run 271828182
run 2718281828
run 27182818284