Add 2012/tromp/try.sh, update bugs.md + formatting

The try.sh has a variety of commands, some that come from the judges and
some that come from the author.

The bugs.md has features added, not bugs.

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

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

The author stated that there is a macro that indicates the term space
but as it's a big number and I don't see it being a problem I did not
(unlike in other cases) add alt code that lets one redefine it.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-30 10:43:38 -08:00
1 parent 54cfecae4f
commit a6d1c17e98
5 files changed
+200 -27

No files matched your search

+122
View File
@@ -0,0 +1,122 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2012/tromp
#
# 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
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
# shellcheck disable=SC2140
echo "$ (cat hilbert.Blc; echo -n "1") | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
(cat hilbert.Blc; echo -n "1") | ./tromp
echo 1>&2
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
# shellcheck disable=SC2140
echo "$ (cat hilbert.Blc; echo -n "12") | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
(cat hilbert.Blc; echo -n "12") | ./tromp
echo 1>&2
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
# shellcheck disable=SC2140
echo "$ (cat hilbert.Blc; echo -n "123") | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
(cat hilbert.Blc; echo -n "123") | ./tromp
echo 1>&2
echo "$ (cat hilbert.Blc; echo -n 1234) | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
(cat hilbert.Blc; echo -n 1234) | ./tromp
echo 1>&2
echo "$ echo " Hello, world" | ./tromp"
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo " Hello, world" | ./tromp
echo 1>&2
echo "$ echo "*Hello, world" | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "*Hello, world" | ./tromp
echo 1>&2
echo "$ (cat uni8.Blc; echo " Ni hao") | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
(cat uni8.Blc; echo " Ni hao") | ./tromp
echo 1>&2
echo "$ cat primes.blc | ./tromp -b | head -c 70" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
cat primes.blc | ./tromp -b | head -c 70
echo 1>&2
echo "$ (cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70" 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
(cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70
echo 1>&2
echo "$ cat hw.bf" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
cat hw.bf
echo 1>&2
echo "$ cat bf.Blc hw.bf | ./tromp" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
# There's no such thing as a useless cat so we silence:
#
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
#
# shellcheck disable=SC2002
cat bf.Blc hw.bf | ./tromp
echo 1>&2
echo "We also recommend that you check the author's remarks for more examples." 1>&2