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.
CS Games 2023 Team A Application
Full Name
Abel Anderson
UWindsor Email
[email protected]
Application Form
Briefly explain how your solution works and how to run it
Explanation of solution
This is a fairly simple brute force approach to this problem.
First, we loop through the provided board until we find a letter that matches the first letter in the word. It will then call the findString function.
The findString function takes in four parameters:
When we first enter this function it will check to see if we are searching for an empty word. If so, we have a valid solution.
If we have not found a valid solution yet, we add the current coordinate to the visited coordinates and recursively call this function on the four cardinal directions, first checking to see that:
If we have searched all cardinal directions and have not found a valid solution, we remove this coordinate from the visited coordinates and return false.
Running & Testing
To test this solution, simply add your boards and associated tests to the testCases array.
This was built and tested on Python 3.7.9, so please test with an appropriate version.