Skip to content

ali8hsn/anagram-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AnaGame — Terminal Anagram Game

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).


How It Works

  • 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 hint to get a starting word to work from
  • At the end, you see your score, accuracy, skill rating, and every word you missed

Scoring

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.


Tech

  • 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

Getting Started

git clone https://github.com/coscoo/anagram-game.git
cd anagram-game
python AnaGame.py

No dependencies to install. Just Python 3.10+.


Project Structure

anagram-game/
├── AnaGame.py              # Game loop, scoring, stats
├── AnagramExplorer.py      # Trie-based anagram engine
└── valid_anagame_words.py  # Dictionary word list loader

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages