How It Works
Word Search Strategy
Everyone has a word search strategy. Some just scan from top to bottom of the word search looking for full words. Others look for the first letter of the word and look for next letters in every direction. Our goal was to find an algoritim, or series of steps that a computer can do.
Even though the computer can solve the word search quickly, if it takes 20 minutes to type in the letters, many will just do the puzzle. So we have 2 issues to solve
- Entering the word search from paper efficiently.
- Solving the word search itself.
Our Tech Stack
This project takes advantage of the following technologies from Amazon Web Services (AWS)
- Amazon S3 - Store the website and any uploaded photos
- Amazon Textract - Extract the text from a photo of a section of the word search
- Amazon Lambda - A cloud based program that takes the photo from S3 and sends it to Textract for processing
- Amazon API Gateway - Communicates with your browser to send the name of the photo to the Lambda
- Amazon Cloud Front - For Caching and Secure Access to the website
- Amazon Javascript SDK - allows us to connect to amazon services from the browser
- Javascript - simple language that runs in every browser
- JQuery - a simple javascript library that allows you quickly perform specific tasks in the program
- Bootstrap 5 - used to build the page components
- HTML - used to layout the basic look of the page
The Algorithm
The algorithm describes the steps we take to solve the word search once it is loaded on screen
The program treats the word search as a grid of letters. Each cell has a coordinate, from (0,0) to the the number of rows and columns minus 1 (14, 14). We count from zero in programming
Indexing the Letters
When we build the grid of letters we take care to remember where every letter is. For each letter we save a list of cells that it belongs to. For exampl the letter A might be in cells (0,0), (1,9) and (7,10). When we have a word that begins with the letter A we only have 3 cells to search!
Indexing means to put information into a compact structure in order to make searches faster.
The Search Process
Once we locate a cell with the first letter, we tend to do the following steps with our eyes and mind:
- We look for the second letter of the word in 8 directions around the starting cell
- We discard all other cells that don't have he second letters in the next spot
- We now focus on the 3rd letter in the same direction as the second
- We repeat this process until we have found every letter going in one direction or discarded all options
We might start with searching in 8 directions but only one direction will be completely successful.
We will attach a coding tutorial soon that walks through the entire process step by step