Crossword Puzzle Generation Algorithm

Click For 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
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 96 ·
4
Replies
96
Views
10K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 37 ·
2
Replies
37
Views
14K
  • · Replies 21 ·
Replies
21
Views
6K
Replies
9
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K