Skip to content

sergeytrasko/wordle-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordle Solver

This a solver for today's Wordle.

Prerequisites

You should have:

  • Node.js 14+
  • Words file located at /usr/share/dict/words (it should be common location for all Unix-based systems including Mac)

Running the solution

Install all required dependencies:

npm install

Then run:

node src/index.js

See in live action

Wordle.Solver.Demo.mov

How it works

Solution has 2 parts.

First part is responsible for filtering out invalid words based on game's feedback. Initially there is a huge list of 5 letter words where any of them is possible. The engine filters out words that do not match alreay known information (like letter positions). Next engine selects one word with highest score (based on letters probability). Once we get feedback (i.e. which letters are correct, present or absent) we can shrink the word list by eliminating impossible options. This way game goes on till the word is found.

Second part is interaction with browser using Puppeteer - a Node.js library that can interact with Chrome browser. Basically it opens the Wordle game in the browser, types the word and inspects elements for the word feedback.