{"id":17948638,"url":"https://github.com/noahdgrant/squareword-solver","last_synced_at":"2026-01-21T20:34:25.814Z","repository":{"id":258839903,"uuid":"875781725","full_name":"noahdgrant/squareword-solver","owner":"noahdgrant","description":"A solver for the popular Squareword game","archived":false,"fork":false,"pushed_at":"2024-11-29T02:23:11.000Z","size":99,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T09:27:27.435Z","etag":null,"topics":["backtracking-algorithm","c","multiprocessing","solver","squareword"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noahdgrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T20:09:30.000Z","updated_at":"2024-11-29T02:23:13.000Z","dependencies_parsed_at":"2025-04-08T09:37:48.112Z","dependency_job_id":null,"html_url":"https://github.com/noahdgrant/squareword-solver","commit_stats":null,"previous_names":["noahdgrant/squareword-solver"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/noahdgrant/squareword-solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahdgrant%2Fsquareword-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahdgrant%2Fsquareword-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahdgrant%2Fsquareword-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahdgrant%2Fsquareword-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noahdgrant","download_url":"https://codeload.github.com/noahdgrant/squareword-solver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahdgrant%2Fsquareword-solver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28642040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtracking-algorithm","c","multiprocessing","solver","squareword"],"created_at":"2024-10-29T09:07:58.764Z","updated_at":"2026-01-21T20:34:20.806Z","avatar_url":"https://github.com/noahdgrant.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Squareword Solver\n\nThis project is a solver for the [Squareword](https://squareword.org/) game. The\nsolver uses a backtracking algorithm to find all possible solutions given a\nstarting point.\n\nThe solver can also find a combination of words to solve the puzzle in the minimum\nnumber of guesses.\n\n### Word List\n\nAccording to [Squareword](https://squareword.org/), the word list used for the\ngame is based on Yet Another Word List (YAWL) by Mendel Leo Cooper. The\n`words.txt` file contains all the five letter words from YAWL.\n\n## Setup\n\n### System\n\nRun the following commands to setup your system and create the necessary files...\n\n```bash\n$ chmod +x setup.sh\n$ ./setup.sh\n```\n\n### input.json\n\nAn `input.json` is created by the `setup.sh` script.\n\nThe blank starting `input.json` should like like the following...\n\n```json\n{\n    \"game_board\": [\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"]\n    ],\n    \"unplaced_letters\": [\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"]\n    ],\n    \"unused_letters\": [\".\"],\n    \"columns\": [\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"]\n    ],\n}\n```\n\n#### Solver\n\nTo setup the solver open `input.json`. A blank space is represented by a `'.'`.\nIn `game_board`, place the **green** letters as they appear on the game board.\nIn `unplaced_letters`, place the **yellow** letters for each row (the order does\nnot matter). In `unused_letters`, place any **gray** letters (if there are no\ngray letters, leave it empty by putting a `'.'`). Once this is done, you can\nbuild and run the solver.\n\n#### Minimum Solution Finder\n\nTo setup the minimum solution finder open `input.json`. A blank space is\nrepresented by a `'.'`. In `columns`, place the missing letters for each column\nin each row of the array.\n\n##### Example\n\nIf the solution is...\n\n```\ntames\natone\nprude\naired\nsands\n```\n\nAnd your current board is...\n\n```\n.....\na..ne\n.ru.e\na....\n.....\n```\n\nThen you are missing...\n\n```\ntames\n.to..\np..d.\n.ired\nsands\n```\n\nSo the `columns` array should look like...\n\n```json\n{\n    \"columns\": [\n        [\"t\", \".\", \"p\", \".\", \"s\"],\n        [\"a\", \"t\", \".\", \"i\", \"a\"],\n        [\"m\", \"o\", \".\", \"r\", \"n\"],\n        [\"e\", \".\", \"d\", \"e\", \"d\"],\n        [\"s\", \".\", \".\", \"d\", \"s\"]\n    ]\n}\n```\n\n## Modes\n\nThis solver has two modes that can solver the puzzle in different ways or can be\nused together.\n\n### Solver\n\nThis mode finds all possible solutions to the puzzle from a given starting point.\n\n#### Processes\n\nBy default the program creates 8 subprocesses to parallelize finding solutions.\nEach process takes the next word in the word list and tries it in the first row.\nIf the word fits in the first row, the subprocess will try all the words in the\nentire word list for rows 2-5. To change the number of subprocesses spawned, change\n`NUM_PROCESSES` in `solver.h`.\n\n### Minimum Solution Finder\n\nThis mode finds a combination of words to solve the puzzle in as few guesses as\npossible. If the puzzle needs 5 guesses to solve, the solution finder will tell\nyou there is no minimum solution possible.\n\n## Build\n\nBuild the project with...\n\n```bash\n$ make\n```\n\nOnce you build the solver, you do not need to build it again unless you make\nchanges to it. To solve a new Squareword, simply update `input.json` to reflect\nthe new board state.\n\n## Run\n\nRun the solver and minimum solution finder with...\n\n```bash\n$ make run\n```\n\nThis will find all possible solutions from the given starting board and the combination\nof words to solve each solution in as few guesses as possible. Only the solver\nportion of the `input.json` file needs to be filled out for this.\n\nRun just the solver with...\n\n```bash\n$ make solver\n```\n\nThis will find all possible solutions from the given starting board. It will not\ntry to find the combination of words to solve they puzzle in as few guesses as\npossible. Only the solver portion of the `input.json` file needs to be filled\nout for this.\n\nRun just the minimum solution finder with...\n\n```bash\n$ make minimum\n```\n\nThis will find the combination of words to solve the puzzle in as few guesses as\npossible for a specific solution. It does not try to find all possible solutions.\nOnly the `columns` portion of the `input.json` needs to be filled out for this.\n\n## Test\n\nRun the tests with...\n\n```bash\n$ make tests\n```\n\n## Clean\n\nClean old build files with...\n\n```bash\n$ make clean\n```\n\n## Example Boards with Intended Solutions\n\n### Solver Example 1\n\nThe solver part of the `input.json` should look like this...\n\n```json\n{\n    \"game_board\": [\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \"t\"],\n        [\".\", \".\", \".\", \".\", \"e\"],\n        [\".\", \"r\", \".\", \".\", \"e\"],\n        [\".\", \"o\", \".\", \".\", \".\"]\n    ],\n    \"unplaced_letters\": [\n        [\"a\", \"i\", \"s\", \"t\", \".\"],\n        [\"i\", \"u\", \"n\", \".\", \".\"],\n        [\"s\", \"o\", \"t\", \".\", \".\"],\n        [\"e\", \"o\", \".\", \".\", \".\"],\n        [\"e\", \"t\", \".\", \".\", \".\"]\n    ],\n    \"unused_letters\": [\".\"]\n}\n```\n\nThe possible solutions found are...\n\n```\nfiats\nunfit\nstole\nerode\ndoted\n\nfiats\nunfit\nstole\nerode\ndoter\n```\n\n### Solver Example 2\n\nThe solver part of the `input.json` should look like this...\n\n```json\n{\n    \"game_board\": [\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \".\", \".\", \".\"],\n        [\".\", \".\", \"u\", \".\", \"e\"],\n        [\"a\", \".\", \".\", \".\", \"e\"],\n        [\".\", \"r\", \".\", \".\", \".\"]\n    ],\n    \"unplaced_letters\": [\n        [\"a\", \"s\", \"m\", \".\", \".\"],\n        [\"a\", \"e\", \".\", \".\", \".\"],\n        [\"e\", \".\", \".\", \".\", \".\"],\n        [\"e\", \"i\", \"r\", \".\", \".\"],\n        [\"a\", \"e\", \".\", \".\", \".\"]\n    ],\n    \"unused_letters\": [\"t\", \"o\", \"n\"]\n}\n```\n\nThe possible solutions found are...\n\n```\nshams\nhazel\nelude\naerie\nfreak\n\nslams\nhazel\nexude\naerie\nfreak\n\nspams\nhazel\nelude\naerie\nfreak\n```\n\n### Minimum Solution Finder Example 1\n\nThe desired solution is...\n\n```\ntames\natone\nprude\naired\nsands\n```\n\nAnd your current board is...\n\n```\n.....\na..ne\n.ru.e\na....\n.....\n```\n\nThen your are missing...\n\n```\ntames\n.to..\np..d.\n.ired\nsands\n```\n\nThe `columns` in the `input.json` should look like this...\n\n```json\n{\n    \"columns\": [\n        [\"t\", \".\", \"p\", \".\", \"s\"],\n        [\"a\", \"t\", \".\", \"i\", \"a\"],\n        [\"m\", \"o\", \".\", \"r\", \"n\"],\n        [\"e\", \".\", \"d\", \"e\", \"d\"],\n        [\"s\", \".\", \".\", \"d\", \"s\"]\n    ]\n}\n```\n\nThe minimum solution found is...\n\n```\ntames\ntardy\npines\nstood\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahdgrant%2Fsquareword-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahdgrant%2Fsquareword-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahdgrant%2Fsquareword-solver/lists"}