Crossword Puzzle Generation Algorithm

AI Thread Summary
A user seeks an efficient method for generating crossword puzzles within a dictionary app, specifically focusing on finding intersecting words without relying on complex loops or brute force. Suggestions include pre-processing the word list into a database format that allows for quick queries based on word length and known letters. The discussion highlights the potential of using a recursive backtracking algorithm as a viable solution. Regular expressions are mentioned but deemed insufficient for the task. Overall, the conversation emphasizes the need for a streamlined approach to procedural crossword generation.
NotASmurf
Messages
150
Reaction score
2
Hey all, for a dictionary app I have to code I have to implement as crossword game as a side feature, unfortunately this is compulsory, I can't figure out a good way of finding words that intersect each other (esp words that intersect multiple others) without a hell of a lot of goto and while's. Is there a good, inexpensive strategy (so no genetic algorithms or pure bruteforce) given a list of words, to find good intersections to procedural generate the crossword without while loops that may not even be guaranteed to resolve themselves? Any help appreciated.
 
Technology news on Phys.org
Thanks but that's just abstracting the loop, I'm certain the key lies in pre-processing the data.
 
You could, of course, put all the words in a database:
  • Word
  • Dictionary entry
  • Word length
  • First letter
  • (Second letter etc.)
Now you have pre-processed the data. In order to find the word you want, create a query incorporating the word length and known letters...
 
  • Like
Likes harborsparrow
NotASmurf said:
Hey all, for a dictionary app I have to code I have to implement as crossword game as a side feature, unfortunately this is compulsory, I can't figure out a good way of finding words that intersect each other (esp words that intersect multiple others) without a hell of a lot of goto and while's. Is there a good, inexpensive strategy (so no genetic algorithms or pure bruteforce) given a list of words, to find good intersections to procedural generate the crossword without while loops that may not even be guaranteed to resolve themselves? Any help appreciated.

Transform code to produce a crossword (7 letters).

compile
 
  • Like
Likes Ibix
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...

Similar threads

2
Replies
96
Views
10K
Replies
13
Views
3K
Replies
7
Views
3K
Replies
7
Views
4K
Replies
37
Views
14K
Replies
21
Views
6K
Replies
2
Views
2K
Back
Top