Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # We own a set of alphabet blocks. There are 24 of them: one letter on each
- # (with drawings of things that start with that letter), and X, Y, and Z are all
- # on one block. We took the letters for our daughters name (no repeats, phew!)
- # and they sit on a shelf in her room. The rest are with her toys in the living
- # room.
- #
- # Here's how I figured out the longest words I could spell with the remaining
- # blocks (buchwald, plutarch, abruptly, upwardly, watchful, and wrathful).
- cat $WORDFILE | # Replace with a word file on your machine, probably one in /usr/share/dict/ \
- tr '[A-Z]' '[a-z]' | # Convert all to lowercase \
- grep -v '[removedword]' | # Remove words that contain the letters from a word \
- grep -v '\(.\).*\1' | # Remove words with one letter more than once \
- grep -v '[xyz].*[xyz]' | # Remove words with more than one of [xyz] \
- awk '{ print length, $0 }' | sort -n -s -r | cut -d" " -f2- | # Sort by length \
- head -20 # Just show the top 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement