{"id":21300835,"url":"https://github.com/neverstew/cwords","last_synced_at":"2025-08-26T09:19:51.693Z","repository":{"id":259817539,"uuid":"879494828","full_name":"neverstew/cwords","owner":"neverstew","description":"Generate crosswords","archived":false,"fork":false,"pushed_at":"2024-12-13T01:13:02.000Z","size":1521,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T18:26:52.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neverstew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-28T02:34:50.000Z","updated_at":"2024-11-18T21:09:26.000Z","dependencies_parsed_at":"2024-11-11T20:27:31.704Z","dependency_job_id":"3bf4e11f-a68d-4940-b763-2eb14d2bbb94","html_url":"https://github.com/neverstew/cwords","commit_stats":null,"previous_names":["neverstew/cwords"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neverstew/cwords","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverstew%2Fcwords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverstew%2Fcwords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverstew%2Fcwords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverstew%2Fcwords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverstew","download_url":"https://codeload.github.com/neverstew/cwords/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverstew%2Fcwords/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272202205,"owners_count":24891164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-21T15:41:36.261Z","updated_at":"2025-08-26T09:19:51.573Z","avatar_url":"https://github.com/neverstew.png","language":"TypeScript","readme":"# cwords\n\nWelcome to this absolute mess of a project, generating crosswords.\n\n## How it works\n\nIf you squint at the problem of setting a crossword grid, it looks like a whole\nbunch of simultaneous equations that all relate to each other;\nword one overlaps with word two, which overlaps with word 3 etc.\n\nThis is a great type of problem to throw at database engines, which are very\nwell set up to find a set of answers, given a whole host of constraints.\n\nWe create a database where the table has one column per space in the grid,\nthen we simply craft a host of queries that represent each word in that grid\nand how they're constrained by each other.\n\nRight now, it can produce a 5x5 grid only.\n\n## Setup\n\nWe've already pulled some words from the internet and shoved them into the\n`words.db` file. This is an SQLite database file.\n\nTo regenerate this, grab a list of words, edit and run \n```sh\nbun run init $path_to_words_file\n```\n\n## Creating crossword grids\n\nYou need to generate a structure file (there's an example already at [structure.txt](./structure.txt)). This describes the shape of the grid that you want.\n\n```\n+ + + + +\n. . + . .\n. . + . .\n. . + . .\n+ + + + +\n```\n\nEach space in the grid should be filled with one of:\n\n* `.` for no letter\n* `+` for any letter\n* `a` (or b etc.) for a specific letter\n\nYou can then generate a new crossword grid by running\n```sh\nbun run generate $path_to_structure_file\n```\n\nGiven the above structure, you would see\n```\na b o u t\n. . f . .\n. . f . .\n. . e . .\na p r i l\n\nabout\noffer\napril\n```\n\n### Getting another one\nIf you don't like the words output, you can look for the next matching result by specifying an offset to the script. This will give you the next result, sorted alphabetically. e.g.\n```sh\nbun run generate $path_to_structure_file 43\n```\n\nThere are usually many, many combinations. Don't be afraid of big numbers!\n\n### Generating JSON\nTo put the puzzle into the app, you can generate the JSON output of the words that the app expects.\n\n```sh\nbun run generate $path_to_structure_file $offset json\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverstew%2Fcwords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneverstew%2Fcwords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverstew%2Fcwords/lists"}