6 files changed
+133
-5
No files matched your search
+12
-4
@@ -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
|
||||
|
||||
Executable
+28
@@ -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
|
||||
Executable
+28
@@ -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
|
||||
Executable
+28
@@ -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
|
||||
Executable
+28
@@ -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
|
||||
+9
-1
@@ -1960,7 +1960,15 @@ check the [bugs.md](bugs.md) file.
|
||||
|
||||
## <a name="1994_tvr"></a>[1994/tvr](/1994/tvr/tvr.c) ([README.md](/1994/tvr/README.md]))
|
||||
|
||||
[Cody](#cody) made this use `fgets(3)` instead of `gets(3)`. In this case the newline had
|
||||
[Cody](#cody) added the try scripts, four total, colour and black and white
|
||||
pairs for the original entry and the alt code. These scripts are
|
||||
[try.color.sh](/1994/tvr/try.color.sh), [try.bw.sh](/1994/tvr/try.bw.sh),
|
||||
[try.alt.color.sh](/1994/tvr/try.alt.color.sh) and
|
||||
[try.alt.bw.sh](/1994/tvr/try.alt.bw.sh), respectively. The scripts go through
|
||||
each mode allowed with two sizes, 128 and 256, allowing one to quit or skip each
|
||||
(given that there are a lot of invocations this seemed like a good idea).
|
||||
|
||||
Cody also made this use `fgets(3)` instead of `gets(3)`. In this case the newline had
|
||||
to be terminated but it was a pretty straightforward fix. `gets()` was defined
|
||||
to use `fgets()` and the inclusion of `stdio.h` had to be added but to make it
|
||||
more like the original entry this was done in the Makefile. The alt code was
|
||||
|
||||
Reference in new issue
Block a user