{"id":19398982,"url":"https://github.com/michaelwehar/crossword-layout-generator","last_synced_at":"2026-03-08T06:33:17.708Z","repository":{"id":137974682,"uuid":"134038576","full_name":"MichaelWehar/Crossword-Layout-Generator","owner":"MichaelWehar","description":"Crossword Layout Generator - Open Source","archived":false,"fork":false,"pushed_at":"2024-12-20T08:28:38.000Z","size":152,"stargazers_count":70,"open_issues_count":10,"forks_count":26,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T13:32:46.837Z","etag":null,"topics":["crossword-layout","crosswords","generator","html","javascript","nodejs","npm-package","open-source","webapp","word-search"],"latest_commit_sha":null,"homepage":"http://michaelwehar.com/crosswords","language":"JavaScript","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/MichaelWehar.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":"2018-05-19T07:04:27.000Z","updated_at":"2025-03-24T20:25:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"35594838-5491-45b6-a360-046c033cc181","html_url":"https://github.com/MichaelWehar/Crossword-Layout-Generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelWehar%2FCrossword-Layout-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelWehar%2FCrossword-Layout-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelWehar%2FCrossword-Layout-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelWehar%2FCrossword-Layout-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelWehar","download_url":"https://codeload.github.com/MichaelWehar/Crossword-Layout-Generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190246,"owners_count":20898702,"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","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":["crossword-layout","crosswords","generator","html","javascript","nodejs","npm-package","open-source","webapp","word-search"],"created_at":"2024-11-10T11:07:52.072Z","updated_at":"2026-03-08T06:33:17.663Z","avatar_url":"https://github.com/MichaelWehar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crossword Layout Generator - Open Source\n## Introduction\nA crossword consists of clues, answers, and a layout:\n- The answers are the hidden words that the player is trying to guess.\n- Each answer has a clue which is a sentence or phrase that helps the player to guess the associated answer.\n- The **crossword layout** describes where the answers are located in a two-dimensional grid.\n\nThis crossword layout generator takes in a list of answers and outputs a crossword layout.  Our program **does not** generate the answers or the clues.\n\n## Input and Output Format\n\nAn input is a list of answers in a JSON format.  The clues can optionally be included with the input.\n\nHere is an example input:\n\n`[{\"clue\":\"that which is established as a rule or model by authority, custom, or general consent\",\"answer\":\"standard\"},{\"clue\":\"a machine that computes\",\"answer\":\"computer\"},{\"clue\":\"the collective designation of items for a particular purpose\",\"answer\":\"equipment\"},{\"clue\":\"an opening or entrance to an inclosed place\",\"answer\":\"port\"},{\"clue\":\"a point where two things can connect and interact\",\"answer\":\"interface\"}]`\n\nThe output is a crossword layout.  That is, we associate a position, startx, starty, and orientation with each answer.\n\nHere is an example output:\n\n`[{\"clue\":\"the collective designation of items for a particular purpose\",\"answer\":\"equipment\",\"startx\":1,\"starty\":4,\"position\":1,\"orientation\":\"across\"},{\"clue\":\"an opening or entrance to an inclosed place\",\"answer\":\"port\",\"startx\":5,\"starty\":4,\"position\":2,\"orientation\":\"down\"},{\"clue\":\"that which is established as a rule or model by authority, custom, or general consent\",\"answer\":\"standard\",\"startx\":8,\"starty\":1,\"position\":3,\"orientation\":\"down\"},{\"clue\":\"a machine that computes\",\"answer\":\"computer\",\"startx\":3,\"starty\":2,\"position\":4,\"orientation\":\"across\"},{\"clue\":\"a point where two things can connect and interact\",\"answer\":\"interface\",\"startx\":1,\"starty\":1,\"position\":5,\"orientation\":\"down\"}]`\n\nOne can visualize the output as follows:\n\n![Example Output](https://github.com/MichaelWehar/Crossword-Layout-Generator/blob/master/example_images/crossword1_filled.png)\n\n## Getting Started\n\n**Step 1:** Add the following line to the head of your html document:\n\n`\u003cscript src=\"layout_generator.js\"\u003e\u003c/script\u003e`\n\n**Step 2:** In the body of your html document, you can add the following JavaScript:\n\n```\n\u003cscript\u003e\n...\nvar layout = generateLayout(input_json);\nvar rows = layout.rows;\nvar cols = layout.cols;\nvar table = layout.table; // table as two-dimensional array\nvar output_html = layout.table_string; // table as plain text (with HTML line breaks)\nvar output_json = layout.result; // words along with orientation, position, startx, and starty\n...\n\u003c/script\u003e\n```\n\n**Update:** Our crossword layout generator is now available as a package for Node.js applications.  For more information, see the Node.js version of our README here: https://github.com/MichaelWehar/Crossword-Layout-Generator/blob/npm/README.md\n\nAlso, see our package's npm listing here: https://www.npmjs.com/package/crossword-layout-generator\n\n## Demo Website\n\nThe demo website's source code can be found in `index.html`.\n\nThe demo website shows:\n\n- how to generate the crossword layout in a JSON format\n\n- how to generate the crossword layout in a plain text grid format (using HTML line breaks).\n\n- how to turn your crossword layout into a **word search puzzle** with horizontal and vertical answers.\n\n**Demo:** http://michaelwehar.com/crosswords\n\n**Short Article:** https://makeprojects.com/project/crossword-layout-generator---open-source\n\n## Information for Advanced Users\n\n- The generated layouts don't always contain all of the input words.  If a word does not appear in the layout, then its orientation attribute will be set to \"none\".\n\n- The generated crossword layouts are not always connected.  Occasionally, there will be islands of disconnected words.\n\n- The program is efficient on small word lists, but it runs noticably slower when the list contains more than 100 words.\n\n- We are still exploring potential ways to evaluate the quality of the generated crossword layouts.  See [Issue #2](https://github.com/MichaelWehar/Crossword-Layout-Generator/issues/2).\n\n## License\n- MIT\n\n## Credits\n- Michael Wehar\n- Itay Livni\n- Michael Blättler\n\n## Updates (December 2024)\n\nI also co-implemented an algorithm for automatic crossword puzzle filling.  Take a look at the new repository here @ [Automatic Crossword Puzzle Filling](https://github.com/MichaelWehar/Automatic-Crossword-Puzzle-Filling)\n\n## External Projects That Use Our Library\n\n- [WoordSchaap](https://github.com/erasche/woordschaap)\n\n- [Collaboration with TapNotion at PyCon 2018](https://pycon-archive.python.org/2018/schedule/presentation/179/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelwehar%2Fcrossword-layout-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelwehar%2Fcrossword-layout-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelwehar%2Fcrossword-layout-generator/lists"}