-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathtry.bw.sh
More file actions
executable file
·28 lines (25 loc) · 686 Bytes
/
try.bw.sh
File metadata and controls
executable file
·28 lines (25 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
#
# try.bw.sh - demonstrate IOCCC entry 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