Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergeytrasko/wordle-solver
Node.js and Puppeteer based solver for Wordle game
https://github.com/sergeytrasko/wordle-solver
puppeteer wordle wordle-solver
Last synced: 21 days ago
JSON representation
Node.js and Puppeteer based solver for Wordle game
- Host: GitHub
- URL: https://github.com/sergeytrasko/wordle-solver
- Owner: sergeytrasko
- Created: 2022-09-10T07:20:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-11T08:30:51.000Z (over 2 years ago)
- Last Synced: 2024-10-30T05:58:49.249Z (2 months ago)
- Topics: puppeteer, wordle, wordle-solver
- Language: JavaScript
- Homepage: https://www.youtube.com/channel/UCHExvm1R3a7NFk5K89jUg7Q
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Wordle Solver
This a solver for today's [Wordle](https://www.nytimes.com/games/wordle/index.html).
## 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:
```bash
npm install
```Then run:
```bash
node src/index.js
```## See in live action
https://user-images.githubusercontent.com/8128865/189473638-0f6a72f1-e58c-4ea9-877f-a6bdb5756755.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](https://pptr.dev/) - 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.