Created
January 21, 2022 17:14
-
-
Save zemanlx/402161dc13f588b6b42eea0f9b3899a7 to your computer and use it in GitHub Desktop.
Solving Wordle with Bash and friends: Create dictionary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visit Solving Wordle with Bash and friends: Create dictionary to see the original article.