Fix 2014/sinon + add try.sh + formatting
The mode where the game would play by itself did not work because the code had 'sinon.c' in it but this does not exist. Now the code refers to 'prog.c'. Add try.sh script that is an improvement over the previous try command (or commands in a sequence) in that it loops, asking if you wish to try again in case of a jam (or any other reason). Format/typo check README.md. This should complete the review of 2014/sinon.
This commit is contained in:
1 parent
b3b93b42ea
commit
93d27e535d
4 files changed
+51
-7
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2014/sinon
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
# clear screen after compilation so that only the entry is shown
|
||||
clear
|
||||
|
||||
while :; do
|
||||
|
||||
cp -f prog.c run.c; ./hecate.sh; ./glock.sh; sleep 3; ./glock.sh; sleep 1; ./hecate.sh
|
||||
|
||||
read -r -p "Do you want to try again (Y/N)? "
|
||||
if [[ "$REPLY" != "y" && "$REPLY" != "Y" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user