Skip to content

Instantly share code, notes, and snippets.

@kedarmhaswade
Last active April 25, 2024 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kedarmhaswade/5175834305e54d6540637d0cae32328f to your computer and use it in GitHub Desktop.
Save kedarmhaswade/5175834305e54d6540637d0cae32328f to your computer and use it in GitHub Desktop.
a short zsh program to create 3 consonant clusters from /usr/share/dict/words (not very efficient; done in the spirit of McIlroy, and not Knuth)
#! /bin/zsh
vo=(a e i o u y)
for u in {a..z}
do
for v in {a..z}
do
for w in {a..z}
do
if ()(( $@[(Ie)$u] )) $vo; then
continue
fi
if ()(( $@[(Ie)$v] )) $vo; then
continue
fi
if ()(( $@[(Ie)$w] )) $vo; then
continue
fi
grep -ih $u$v$w /usr/share/dict/words
if [[ $status -eq 0 ]]; then
echo "consonant cluster above: $u$v$w"
echo "--------"
fi
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment