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
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

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
5K
Replies
2
Views
2K
Back
Top