Add 1994/tvr try scripts

There are four scripts:

    try.color.sh	# original entry colour mode
    try.bw.sh		# original entry black and white mode
    try.alt.color.sh	# alt code colour mode
    try.alt.bw.sh	# alt code black and white mode
This commit is contained in:
Cody Boone Ferguson committed 2024-01-16 06:38:39 -08:00
1 parent 329e9470be
commit a2cf06b80f
6 files changed
+133 -5

No files matched your search

+12 -4
View File
@@ -26,16 +26,16 @@ For more detailed information see [1994 tvr in bugs.md](/bugs.md#1994-tvr).
./tvr mode screensize/2 < colormapfile
```
Mode may be a value from 0 to 12.
## Try:
```sh
./tvr 0 128 < tvr.color (for color displays)
./tvr 0 128 < tvr.bw (for Black & White displays)
./try.color.sh # for colour displays
./try.bw.sh # for Black & White displays
```
Mode may be a value from 0 to 12.
## Alternate code:
@@ -59,6 +59,14 @@ where `altmode` `1` - `4` correspond to mode `0` - `3` in the original entry and
`altmode 0` calculates Mandelbrot/Julian sets correctly.
## Alternate try:
```sh
./try.alt.color.sh # for colour displays
./try.alt.bw.sh # for Black & White displays
```
## Judges' remarks:
This entry requires the use of X11. It will form two windows (hopefully your
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# try.alt.bw.sh - demonstrate IOCCC winner 1994/tvr alt code B&W mode
#
# 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" alt >/dev/null || exit 1
for mode in $(seq 0 4); do
for size in 128 256; do
read -r -n 1 -p "Press any key to run: ./tvr.alt $mode $size < tvr.bw (q = quit, s = skip): "
echo 1>&2
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
exit 0
elif [[ "$REPLY" == "s" || "$REPLY" == "S" ]]; then
continue
fi
echo 1>&2
./tvr.alt "$mode" "$size" < tvr.bw
echo 1>&2
done
done
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# try.color.sh - demonstrate IOCCC winner 1994/tvr alt code colour mode
#
# 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" alt >/dev/null || exit 1
for mode in $(seq 0 4); do
for size in 128 256; do
read -r -n 1 -p "Press any key to run: ./tvr.alt $mode $size < tvr.color (q = quit, s = skip): "
echo 1>&2
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
exit 0
elif [[ "$REPLY" == "s" || "$REPLY" == "S" ]]; then
continue
fi
echo 1>&2
./tvr.alt "$mode" "$size" < tvr.color
echo 1>&2
done
done
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# try.bw.sh - demonstrate IOCCC winner 1994/tvr B&W mode
#
# 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
for mode in $(seq 0 12); do
for size in 128 256; do
read -r -n 1 -p "Press any key to run: ./tvr $mode $size < tvr.bw (q = quit, s = skip): "
echo 1>&2
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
exit 0
elif [[ "$REPLY" == "s" || "$REPLY" == "S" ]]; then
continue
fi
echo 1>&2
./tvr "$mode" "$size" < tvr.bw
echo 1>&2
done
done
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# try.color.sh - demonstrate IOCCC winner 1994/tvr colour mode
#
# 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
for mode in $(seq 0 12); do
for size in 128 256; do
read -r -n 1 -p "Press any key to run: ./tvr $mode $size < tvr.color (q = quit, s = skip): "
echo 1>&2
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
exit 0
elif [[ "$REPLY" == "s" || "$REPLY" == "S" ]]; then
continue
fi
echo 1>&2
./tvr "$mode" "$size" < tvr.color
echo 1>&2
done
done