Fix and improve 2014/sinon scripts
The try script now runs the demo mode if perl is installed. It also now prompts before running each script (the below noted ones) so that one can control the pace of the output a bit more. The glock.sh and hecate.sh scripts could only be run once successfully because the output of run.c overwrites it (with non code). First one has to do cp -f prog.c run.c which the scripts now do. This was not a problem in the try script because I added that step explicitly (and is now not needed or there).
This commit is contained in:
1 parent
691a901b55
commit
0903d9f3b9
5 files changed
+47
-16
No files matched your search
+24
-1
@@ -15,9 +15,32 @@ make CC="$CC" all >/dev/null || exit 1
|
||||
# clear screen after compilation so that only the entry is shown
|
||||
clear
|
||||
|
||||
# find out if perl is installed
|
||||
PERL="$(type -P perl)"
|
||||
if [[ -n "$PERL" ]]; then
|
||||
read -r -n 1 -p "Press any key to play the game automatically ($PERL prog.c | bash): "
|
||||
echo 1>&2
|
||||
"$PERL" prog.c | bash
|
||||
echo 1>&2
|
||||
fi
|
||||
|
||||
while :; do
|
||||
|
||||
cp -f prog.c run.c; ./hecate.sh; ./glock.sh; sleep 3; ./glock.sh; sleep 1; ./hecate.sh
|
||||
read -r -n 1 -p "Press any key to run: ./hecate.sh: "
|
||||
echo 1>&2
|
||||
./hecate.sh
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./glock.sh: "
|
||||
echo 1>&2
|
||||
./glock.sh
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./glock.sh: "
|
||||
echo 1>&2
|
||||
./glock.sh
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./hecate.sh: "
|
||||
echo 1>&2
|
||||
./hecate.sh
|
||||
|
||||
read -r -p "Do you want to try again (Y/N)? "
|
||||
if [[ "$REPLY" != "y" && "$REPLY" != "Y" ]]; then
|
||||
|
||||
Reference in new issue
Block a user