sergeytrasko / wordle-solver

Node.js and Puppeteer based solver for Wordle game

Home Page:https://www.youtube.com/channel/UCHExvm1R3a7NFk5K89jUg7Q

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Node.js and Puppeteer based solver for Wordle game

https://www.youtube.com/channel/UCHExvm1R3a7NFk5K89jUg7Q


Languages

Language:JavaScript 100.0%