Add 2004/kopczynski/try.sh + data files

Added try.sh.

Add data files with reversed output of their respective file. I used
rev(1) to make these but kopczynski-10-rev had to be modified a bit more
to get it to work.

Format/typo check README.md.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-18 11:34:45 -08:00
1 parent 8236f9ac54
commit 9d6c5c0a4c
10 files changed
+90 -9

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2004/kopczynski
#
# 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
for f in kopczynski-{8{a,b,c},a,9{,-rev},10{,-rev},11{,-rev}}; do
echo "$ cat $f" 1>&2
cat "$f"
read -r -n 1 -p "Press any key to continue: "
./kopczynski < "$f"
echo "" 1>&2
done