We look at a hidden word and its first letter then we proceed to look for the first letter inside the grid of letters.
![find word in file python find word in file python](https://btechgeeks.com/wp-content/uploads/2021/06/Screenshot-239-768x313.png)
How and where do we start?īefore going deeper into the computer side of the algorithm, let’s first clarify how we tend to solve a word search puzzle: In some word search puzzles, a limitation exists in the length of the hidden words, in that it should contain more than 2 characters, and the grid should have a fixed size of 10 × 10, or an equivalent length and width proportion (which this python implementation doesn’t have). After all the words are found, the remaining letters of the grid expose a secret message.
![find word in file python find word in file python](https://www.codegrepper.com/codeimages/how-to-check-if-a-certain-word-is-in-a-text-file-with-python.png)
The word could be oriented vertically, horizontally, diagonally, and also inversely in the previously mentioned directions. How a traditional word search puzzle works is, for a given grid of different characters, you have to find the hidden words inside the grid. They can be located sometimes in bookstores, around the trivia area, as a standalone puzzle book, in which the sole content is a grid of characters and a set of words per page.
![find word in file python find word in file python](https://www.codegrepper.com/codeimages/how-to-call-a-function-from-another-file-in-python.png)
Word search is a puzzle we usually see in newspapers, and in some magazines, located along the crossword puzzles. This implementation of Word Search was, in most part, an experiment-to observe how I utilize Python to try and solve the problem of implementing a basic word search solving algorithm.