Rename 2019/karns/demo.sh try.sh
It was already documented as such (in the thanks file) but it was still the old name (demo.sh). The README.md had demo.sh still but this has been updated as it's all for the try section.
This commit is contained in:
1 parent
43f4b68245
commit
396f92f9b0
3 files changed
+15
-6
No files matched your search
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Demo of IOCCC 26 (2019) 'Most in need of whitespace' entry by Joshua Karns.
|
||||
#
|
||||
# Doesn't run the program on README.md as it's longer and slower.
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
# display prog.c to the user
|
||||
echo "$ cat prog.c"
|
||||
cat prog.c
|
||||
sleep 2
|
||||
|
||||
# run the program on itself
|
||||
echo "$ ./prog < prog.c"
|
||||
sleep 2
|
||||
./prog < prog.c
|
||||
sleep 2
|
||||
|
||||
# reset terminal for colours
|
||||
reset
|
||||
|
||||
# display maze
|
||||
echo "$ cat maze"
|
||||
cat maze
|
||||
sleep 2
|
||||
|
||||
# run the program on maze
|
||||
echo "$ ./prog < maze"
|
||||
sleep 2
|
||||
./prog < maze
|
||||
|
||||
sleep 2
|
||||
# reset terminal
|
||||
reset
|
||||
Reference in new issue
Block a user