https://github.com/charlespascoe/squaredle-solver
https://github.com/charlespascoe/squaredle-solver
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/charlespascoe/squaredle-solver
- Owner: charlespascoe
- License: mit
- Created: 2026-04-11T15:01:01.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-11T15:04:07.000Z (2 months ago)
- Last Synced: 2026-04-11T17:09:38.917Z (2 months ago)
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Squaredle Solver
A solver and generator for [Squaredle](https://squaredle.app/) puzzles.
## How it works
A list of acceptable words is loaded from a file into a prefix trie, then the
solver runs a depth-first search from every cell in the grid, pruning branches
as soon as the current path doesn't match any prefix in the trie. This makes it
fast even on large grids with big word lists.
The generator works by filling a grid with random letters (weighted by letter
frequency in the word list), solving it, then re-randomising any cells that
aren't covered by at least one solution. It repeats this until every cell
participates in a word. Note that the generator doesn't have a concept of
"bonus" words - all words in the given word list are considered acceptable
matches.
## Usage
This project expects a Scrabble word list file. The default is
[NSWL2023.txt](https://raw.githubusercontent.com/scrabblewords/scrabblewords/refs/heads/main/words/North-American/NSWL2023.txt)
from the [scrabblewords repo](https://github.com/scrabblewords/scrabblewords).
Download it into the project root before running.
To build:
```
go build -o squaredle-solver .
```
To solve a grid:
```
./squaredle-solver -solve grid.txt
```
`grid.txt` is a file that looks like this:
```
pkili
oiebs
iacle
snsee
ndisb
```
Generate a random 5x5 (Row x Col) grid and print all solutions:
```
./squaredle-solver -generate 5x5
```
See `./squaredle-solver -h` for more options.