Skip to content

Instantly share code, notes, and snippets.

@zemanlx
Created January 21, 2022 17:14
Show Gist options
  • Save zemanlx/402161dc13f588b6b42eea0f9b3899a7 to your computer and use it in GitHub Desktop.
Save zemanlx/402161dc13f588b6b42eea0f9b3899a7 to your computer and use it in GitHub Desktop.
Solving Wordle with Bash and friends: Create dictionary
#!/bin/bash
# Install American dictionary
sudo apt-get install wamerican
# See first 10 words
head /usr/share/dict/american-english
# Count words in the dictionary
wc -l /usr/share/dict/american-english
# Create Wordle dictionary (all five-letter words)
grep -P "^[a-z]{5}$" /usr/share/dict/american-english \
> wordle.dictionary
# Count words in the Wordle dictionary
wc -l wordle.dictionary
# Get execution time of Wordle dictionary creation
time grep -P "^[a-z]{5}$" /usr/share/dict/american-english \
> wordle.dictionary
@zemanlx
Copy link
Author

zemanlx commented Jan 21, 2022

Visit Solving Wordle with Bash and friends: Create dictionary to see the original article.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment