Solver¶
Module implementing all solvers of Wordle.
- class wordle_game.solver.BaseSolver¶
Base Wordle solver.
- simulate() List[int] ¶
Simulate game and return distribution of rounds to win.
- simulate_game(game) int ¶
Simulate game and return rounds to win.
- class wordle_game.solver.MaxEntropy(wordlist=<wordle_game.wordle.WordList object>)¶
Maximize entropy.
Determine optimal next guess by maximizing entropy of each guess. Entropy is maximized by having as close to uniform a distribution of possible answers across unique state responses.
- guess(game: wordle_game.wordle.WordleGame)¶
Determine optimal guess.
- class wordle_game.solver.RandomSolver(wordlist=<wordle_game.wordle.WordList object>)¶
Naive solution.
Randomly select the first potential answer of the list of remaining possible answers at each game iteration.
- guess(game: wordle_game.wordle.WordleGame)¶
Determine optimal guess.
- wordle_game.solver.convert_state(state: numpy.ndarray)¶
Convert state to unique numerical representation for performance.
Given each digit can be in one of three states each individual state response can be represented by a ternary number.
- wordle_game.solver.filter_answers(game) List[str] ¶
Filter for potential answers.
- Parameters
game (WordleGame, required) – Game being played.
- Returns
filtered_answers – List of possible answers after filtering out initial list using the list of guesses and state responses.
- Return type
List[str]