Skip to content

funnymonke0/wordle-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

WordleEngine

WordleEngine is a solver for the popular word game Wordle written natively in Python. It prunes the wordlist based on results of guesses and applies a scoring algorithm based on which word will extract the most information and eliminate the most possibilities.


Requirements

  • Python 3.x
  • Two word list files:
    • answer.txt – List of possible Wordle answers (one per line).
    • valid_wordle_words.txt – List of all acceptable guesses (one per line).

How to Use

  1. Prepare Word Lists
    Ensure you have answer.txt and valid_wordle_words.txt in the same directory. These files should contain one word per line.

  2. Run the Solver

    python wordle_engine.py
  3. Follow Prompts

    • Enter your guessed word (must be valid and 5 letters).
    • Enter the color clue using:
      • g = green (correct letter, correct spot)
      • y = yellow (correct letter, wrong spot)
      • b = black/gray (letter not in the word)

    Example:

    word: crate
    colors: bgybb
    
  4. The engine will suggest the next best word. Repeat until solved.


Algorithm Summary

  • Filters words based on given colors.
  • Tracks letter frequencies for each position.
  • Scores each candidate word:
    • Rewards high-frequency letters in optimal positions.
  • Selects the best-scoring word as the next guess.

Example Session

word: slate
colors: bbybg
crate
colors: ggygg
crane

Improvements

  • deploy to an actual application
  • improve interface outside of just cli
  • improve input, possibly with tkinter or something more advanced
  • refine algorithm further or try to optimize an better algorithm using ML

About

Implementation of a simple algorithm that looks for the most representative word to obtain the most information possible from each guess.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages