Add 2005/klausler/try.sh + format/typo check

This commit is contained in:
Cody Boone Ferguson committed 2023-11-22 07:43:51 -08:00
1 parent cefc45f635
commit 4e4c67112b
3 files changed
+57 -2

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ make
### Try:
```sh
./klausler peter klausler | head
./try.sh
```
@@ -33,7 +33,7 @@ Rules might have to be changed!
## Author's remarks:
A useful tool to help one appear extra smart and witty when
[IRC](https://en.wikipedia.org/wiki/Internet_Relay_Chat)ing, or even
[IRCing](https://en.wikipedia.org/wiki/Internet_Relay_Chat), or even to
just be highly annoying.
Finds best anagrams for word or phrase given as program arguments. Use only
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2005/klausler
#
# 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
echo "$ ./klausler peter klausler | head -n 10" 1>&2
./klausler peter klausler | head -n 10
echo "$ ./klausler abc def ghi jkl mno | head -n 10" 1>&2
./klausler abc def ghi jkl mno | head -n 10
echo "$ ./klausler foo bar baz | head -n 10" 1>&2
./klausler foo bar baz | head -n 10
echo "$ ./klausler zebra elephant bear fox | head -n 10" 1>&2
./klausler zebra elephant bear fox | head -n 10
echo "$ ./klausler the lion king | head -n 10" 1>&2
./klausler the lion king | head -n 10
echo "$ ./klausler fire breathing dragon | head -n 10" 1>&2
./klausler fire breathing dragon | head -n 10
echo "$ ./klausler lord of the rings | head -n 10" 1>&2
./klausler lord of the rings | head -n 10
echo "$ ./klausler fawlty towers | head -n 10" 1>&2
./klausler fawlty towers | head -n 10
echo "$ ./klausler carriown fowl | head -n 10" 1>&2
./klausler carriown fowl | head -n 10
echo "$ ./klausler werewolf vampire dragon | head -n 10" 1>&2
./klausler werewolf vampire dragon | head -n 10
echo "$ ./klausler werewolf vampire | head -n 10" 1>&2
./klausler werewolf vampire | head -n 10
+6
View File
@@ -2989,6 +2989,12 @@ Cody added explicit linking of libm (`-lm`) for systems like linux that seem to
not do it implicitly (like macOS does).
## [2005/klausler](2005/klausler/klausler.c) ([README.md](2005/klausler/README.md))
Cody added the [try.sh](2005/klausler/try.sh) script.
## [2005/mikeash](2005/mikeash/mikeash.c) ([README.md](2005/mikeash/README.md))
Cody fixed this to work in linux. The problem was an unknown escape sequence,