Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Keiran!
I came across your project when trying to make my own crossword builder. I love puzzles and seems like a really fun project to contribute to rather than starting from square one. I wanted to take a shot at this feature to get my feet wet. Not too confident my approach is the cleanest or most efficient, and I am very open to your suggestions.
Current State
Currently, when the user clicks on the generate pattern button the program selects a pattern from a predefined array of patterns.
Goal of this PR:
Create a random pattern generator that programmatically creates a unique board each time the user clicks the generate pattern button.
Approach
Given the conventional crossword rules, each word must be 3 letters long and the board should retain rotational symmetry. To do this, I Iooped through each square's location on the grid. I check the surrounding squares of each square looped through. If we are able to add the square based on the given rules, we randomly decide whether or not to add the square to the pattern.
Limitations
Excited to hear your thoughts and looking forward to contributing more in the future!