An interactive Wordle solver built with Python and NiceGUI.
You can play Wordle in the browser and let different AI search strategies (BFS, DFS, Entropy-based, CSP-based) automatically solve the puzzle.
- Python: 3.9+ (project was tested with Python 3.9)
- OS: Windows, macOS, or Linux
- Dependencies: listed in
requirements.txt
You can either use the provided virtual environment in env/ (Windows), or create your own.
From the project root (WordleSolver/), you have two main options.
-
Option A – Use your own virtual environment (recommended)
-
Create and activate venv
# from the project root python -m venv .venv # Windows (PowerShell) .venv\Scripts\Activate.ps1 # Windows (cmd.exe) .venv\Scripts\activate.bat # macOS / Linux source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
-
Option B – Use the existing
env/folder (Windows)
From PowerShell in the project root:.\env\Scripts\Activate.ps1
Once your environment is activated and dependencies are installed, run:
python main.pyBy default NiceGUI will start a local web server (typically at http://127.0.0.1:8080).
Open the printed URL in your browser.
In the UI you can:
- Type guesses using your physical keyboard.
- Select a solver from the dropdown (BFS, DFS, Entropy Solver, CSP Solver).
- Optionally set a start word.
- Click “Auto-solve” to let the chosen solver play.
- Click “Clear All” to reset the game.
main.py: Entry point; starts the NiceGUI app.core/game.py: Core Wordle game logic (state, feedback, validity checks).controller.py: Connects game logic, GUI (gui/view.py), and solvers.
gui/view.py: NiceGUI-based UI (grid, controls, metrics panel).solvers/bfs_solver.py,dfs_solver.py,entropy_solver.py,csp_solver2.py: Different search/AI strategies.
data/: Word lists and precomputed helpers (successors, letter-to-words).experiment/: Scripts and charts for running performance experiments.preprocessing/: Scripts to precompute helper structures (successors, connectivity, etc.).
If you want to reproduce or extend the experimental evaluation of the solvers:
-
Ensure your environment is activated and dependencies are installed.
-
From the project root, run:
python experiment/run_experiment.py
This will use the solvers to run batched games and write statistics/plots into experiment/stats/ and experiment/charts*/.
Note: Depending on your hardware, running all experiments may take some time.