Many thanks for the index.js code, the credit goes all to the website https://crosswordlabs.com and their owners.
If you prefer using a more friendly user interface I recommend heading to their website, it's surely more refined and deserves all the appreciation for the great algorithm and code. Use this tool only if you plan to integrate it in a more nerdy/automated process like I used it to.
- Write down your definitions, use CSV (comma-separated-values) format. Use double quotes for escaping eventual commas in your clues.
- Pipe your definitions in the
csv_parser.pyscript:cat definitions.csv | python csv_parser.py - Open
index.htmlon your browser to generate and choose your design: paste the code generated at the step before into theInputfield, if your input is legally formatted a crossword should appear. - (optional) use the
seedinput to change the generator random noise: if you don't like the crossword you can generate a new one changing this value. Note that if the (clues, seed) tuple doens't change, it should lead to the exact same result each time you generate. - You can copy the generated SVG image from the textbox below the crossword. Then use your favorite tool to convert it to PNG or keep it in SVG format.
- Copy the legend (list of clues) data from the textbox on the button and pipe it to the
legend_parser.pyscript:This will pretty-print your clueswl-paste | python legend_parser.py