Skip to content

Team A Submission - Gabriel Rueda #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gabrielrueda
Copy link

@gabrielrueda gabrielrueda commented Nov 23, 2022

CS Games 2023 Team A Application

PLEASE FILL IN THE FOLLOWING!

Full Name

Gabriel Rueda

UWindsor Email

[email protected]

Application Form

Briefly explain how your solution works and how to run it

My solution would scan through all the elements of the board until the first character of the word is found. Once found, a function called "travelPath()" will run.

travelPath() will check for the word using a DFS algorithm. It will first check all four sides and then if the following letter is found, the function would call itself for the next position. This will continue until either a dead end is found (return false) or the entire word is found (return true). I have also implemented a hashset called visted which is there to ensure that the DFS does not repeat itself on an already visted letter for a word. I implemented the test variable, so if one of the branches fails, but another branch succeeds, then the function will still return true.

Finally, in the the initial loop, if travelPath() function returns true, then the entire function will return true. Otherwise it will continue to search.

To run the program, clone the repo, and then in the terminal type the following command:
python solution.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant