Add 2000/briddlebane/try.sh

Especially useful for those who feel a bit too confident, cocky or even
happy :-)
This commit is contained in:
Cody Boone Ferguson committed 2024-02-05 09:01:25 -08:00
1 parent 8ef224ff00
commit 838e73e9eb
3 files changed
+39

No files matched your search

+8
View File
@@ -17,6 +17,14 @@ make
For some fun every time you log in try running this from your `.bashrc` or
equivalent file!
You might also like to try:
```sh
./try.sh
INSULTS=15 ./try.sh
```
## Judges' remarks:
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2000/briddlebane
#
# 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
[[ -z "$INSULTS" ]] && INSULTS=10
echo "$INSULTS" | grep -qE '^[0-9]+'
if [[ "${PIPESTATUS[1]}" -ne 0 ]]; then
echo "INSULTS value not a positive number, fix and run again."
exit 1
fi
for ((i=0; i<"$INSULTS"; i++)); do
./briddlebane
sleep 1
done
+3
View File
@@ -2511,6 +2511,9 @@ terminal.
[Cody](#cody) fixed this to compile in systems that require one to explicitly link in
`libm`.
Cody also added the [try.sh](/2000/briddlebane/try.sh) script for those who are
feeling a bit too confident, cocky or even happy :-)
## <a name="2000_dhyang"></a>[2000/dhyang](/2000/dhyang/dhyang.c) ([README.md](/2000/dhyang/README.md]))