Add 2006/birken/try.sh, bugs.md, format/typo check
The try.sh runs the program on all the tofu input files, prompting the user to press a key before running each one so they have time to look at the output of the previous one. The README.md file format and typo checked. This should complete 2006/birken except that it uses gets(), not fgets(), which has been added to the bugs.md file. I almost got it to work but it crashes with computer.tofu so I did not change it. Will look at this later, maybe, but the bugs.md has a diff of the single change that almost works. I did not have the time to write where it fails but I do happen to know at least the end result.
This commit is contained in:
1 parent
e9ffd327d6
commit
8231e28567
4 files changed
+108
-13
No files matched your search
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# try.sh - demonstrate IOCCC winner 2006/birken
|
||||
#
|
||||
|
||||
# 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
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < adder.tofu 2>/dev/null: "
|
||||
./birken < adder.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < buffer.tofu 2>/dev/null: "
|
||||
./birken < buffer.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
echo "NOTE: the next one has longer output." 1>&2
|
||||
read -r -n 1 -p "Press any key to run: ./birken < computer.tofu 2>/dev/null: "
|
||||
./birken < computer.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < counter.tofu 2>/dev/null: "
|
||||
./birken < counter.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < divider.tofu 2>/dev/null: "
|
||||
./birken < divider.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < lfsr.tofu 2>/dev/null: "
|
||||
./birken < lfsr.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < memory.tofu 2>/dev/null: "
|
||||
./birken < memory.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < multiplier.tofu 2>/dev/null: "
|
||||
./birken < multiplier.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < multiplier2.tofu 2>/dev/null: "
|
||||
./birken < multiplier2.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < oneline.tofu 2>/dev/null: "
|
||||
./birken < oneline.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < shift.tofu 2>/dev/null: "
|
||||
./birken < shift.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < zuse.tofu 2>/dev/null: "
|
||||
./birken < zuse.tofu 2>/dev/null
|
||||
echo 1>&2
|
||||
|
||||
read -r -n 1 -p "Press any key to run: ./birken < zuse2.tofu 2>/dev/null: "
|
||||
./birken < zuse2.tofu 2>/dev/null
|
||||
Reference in new issue
Block a user