A timed word game where you race to find anagram pairs from a random set of letters.
Built as part of the Jane Street AMP program. AnaGame gives you 7 letters and 60 seconds to spot as many valid anagram pairs as you can — words that use the exact same letters in a different order (e.g. eat and tea).
- You're dealt 7 letters drawn from a Scrabble-weighted distribution (so you get playable combinations, not 7 consonants)
- The letter set is guaranteed to contain at least 100 valid anagram pairs before the game starts
- Type pairs separated by a comma:
eat,tea - Type
hintto get a starting word to work from - At the end, you see your score, accuracy, skill rating, and every word you missed
| Metric | Description |
|---|---|
| Score | Sum of (word length - 2) for each valid unique pair |
| Accuracy | Valid guesses ÷ total guesses (%) |
| Skill | Unique words found ÷ all possible anagram words (%) |
Duplicate pairs and invalid words don't count — and cost you accuracy.
- Python — pure standard library, no dependencies
- Trie / prime-product hashing — fast anagram lookup via
AnagramExplorer - Scrabble letter distribution — weighted random sampling for solvable letter sets
git clone https://github.com/coscoo/anagram-game.git
cd anagram-game
python AnaGame.pyNo dependencies to install. Just Python 3.10+.
anagram-game/
├── AnaGame.py # Game loop, scoring, stats
├── AnagramExplorer.py # Trie-based anagram engine
└── valid_anagame_words.py # Dictionary word list loader
MIT