Improve how to reconfigure coords in 2014/deak
The Makefile now has variables so that one can do something like
make X1=-1 Y2=-1 clobber alt
or whatever, with the variables X1, X2, Y1 and Y2 set to what the author
originally had it as.
The alt code still has #ifndef..#endif so that one can (if they want to
be silly) compile it without make(1).
This commit is contained in:
1 parent
ff201b7a76
commit
ba17ec7e8f
4 files changed
+71
-4
No files matched your search
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.alt.sh - demonstrate IOCCC winner 2014/deak alt code
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
# compile the alt code with various parameters and run it to show different
|
||||
# output
|
||||
|
||||
read -r -n 1 -p "Press any key to change X1 to 2, X2 to -1 and Y1 to -2.3: "
|
||||
echo 1>&2
|
||||
make -B X1=2 X2=-1 Y1=-2.3 alt >/dev/null || exit
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./prog.alt | less -EXF
|
||||
|
||||
read -r -n 1 -p "Press any key to change X1 to 3, X2 to -2 and Y1 to -3.3: "
|
||||
echo 1>&2
|
||||
make -B X1=3 X2=-2 Y1=-3.3 alt >/dev/null || exit
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./prog.alt | less -EXF
|
||||
|
||||
read -r -n 1 -p "Press any key to change X1 to 1, X2 to -1 and Y1 to -0.3: "
|
||||
echo 1>&2
|
||||
make -B X1=1 X2=-1 Y1=-0.3 alt >/dev/null || exit
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./prog.alt | less -EXF
|
||||
|
||||
read -r -n 1 -p "Press any key to change X1 to 1, X2 to -1, Y1 to -0.3 and Y2 to -1.3: "
|
||||
echo 1>&2
|
||||
make -B X1=1 X2=-1 Y1=-0.3 Y2=-1.3 alt >/dev/null || exit
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./prog.alt | less -EXF
|
||||
|
||||
read -r -n 1 -p "Press any key to try the original configuration: "
|
||||
echo 1>&2
|
||||
make clobber alt >/dev/null || exit 1
|
||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||
echo 1>&2
|
||||
./prog.alt
|
||||
Reference in new issue
Block a user