Skip to content

patsoffice/squareword-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Squareword Solver

An HTMX-based web tool for solving Squareword puzzles. Enter your guesses and feedback from the game, and the solver suggests optimal next words.

How Squareword Works

Squareword presents a 5×5 grid where every row and column forms a valid 5-letter word. You get 15 guesses. After each guess:

  • Green letters are placed at their correct position in the grid
  • Yellow letters (shown to the right of each row) are in that row's word but at a different column
  • Grey letters aren't in any word in the grid

Usage

cargo run --bin web

Open http://localhost:3001. Specify a different port with:

cargo run --bin web -- 3002

Workflow

  1. Type a 5-letter guess in the input row
  2. A feedback matrix appears — click cells to cycle through states:
    • EmptyYellowGreenBoth → Empty
    • Rows = grid rows (R1–R5), columns = guess letter positions
    • Both means the letter is in the correct position AND another instance exists in that row
  3. Click Submit
  4. The solution grid updates with confirmed letters, and suggestions narrow
  5. The matrix resets for the next guess — already-confirmed grid positions auto-lock when the guess letter matches

Constraints Tracked

  • Per-row exclusions: letters guessed with no marking for a row are excluded from that row's candidates
  • Global exclusions: letters with no marking in any row are excluded entirely
  • Yellow positions: letters known to be in a row but not at specific columns
  • Minimum counts: "both" feedback tracks when a row needs multiple instances of a letter

Suggestions

The solver shows three types of suggestions:

  • Best Guesses — top words from the overall candidate list, augmented with the highest-ranked word from each unsolved row
  • Row N — words that fit a specific unsolved row given current constraints
  • Col N — words that fit a specific unsolved column

Scoring blends letter frequency among remaining candidates with word commonality from real-world usage data (OpenSubtitles corpus).

Word Sources

Words are loaded from multiple sources at startup:

Combined: ~20,148 five-letter word candidates.

Development

cargo fmt
cargo clippy --all-features --all-targets

Tech Stack

Rust, Axum, Askama, HTMX — same architecture as the Wordle Solver.

About

Enter your Squareword guesses and feedback from the game, and the solver suggests optimal next words.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors