I want to generate all unique crosswords with a specific grid size (4x4 is a good size). All possible puzzles, including unique puzzles, are represented by a binary string with the length of the grid area (16 in the case of 4x4), so all possible 4x4 puzzles are represented by the binary forms of all numbers in the range 0 to 2 ^ 16.
It's easy to create them, but I'm curious if anyone has a good solution on how to programmatically eliminate incorrect and duplicate cases. For example, all puzzles with one column or one row are functionally identical, therefore, excluding 7 of these 8 cases. In addition, in accordance with the crossword puzzle symbols, all squares must be adjacent. I had success by removing all duplicate structures, but my decision took several minutes to execute and probably was not ideal. I am at a loss how to find contact, so if anyone has ideas on this, it will be very helpful.
I would prefer solutions in python, but I will write in any other language that you prefer. If anyone wants to, I can publish my Python code to generate all meshes and remove duplicates, as if slow.
source
share