Kudos to John for being the 2nd public display I've found attempting my Halloween puzzle. Same wrong answers as Tomaaz but John did reference the Rosetta rules for Word Search, so why didn't he employ all tools for the job?
I did NOT know Rosetta actually had a Word Search challenge, This part of their description was followed in my puzzle:
A word search puzzle typically consists of a grid of letters in which words are hidden.
There are many varieties of word search puzzles. For the task at hand we will use a rectangular grid in which the words may be placed horizontally, vertically, or diagonally. The words may also be spelled backwards.
The words may overlap but are not allowed to zigzag, or wrap around.
zigzag probably means start going one direction and then changing course mid-word.
Here is my BASIC strategy for finding words:
For each word in search list
1. Take the first letter and run through the grid of letters for a match.
2. For a matching first letter, check each of 8 directions and see if the length of the word will fit the grid in that direction.
3. If so, build the word from the grid in that direction and length (or check letter by letter and bug out if mismatch).
4. See if it matches the word being searched, if so, count it, display it and/or record the find.
5. Repeat until all words have been searched over the entire grid ie continue with remaining directions then continue with remaining grid, unless you know there is only one word positioned in the puzzle (but my challenge is a twist on the this standard newspaper puzzle).
A BASIC strategy for the 8 directions:
I set up two arrays (or use one of vectors). I called them DX() and DY() because they are the changes (D is for Delta) of position when added to (x, y) coordinate of a location.
A normal word direction (say direction 1) is from left to right due East change X by +1 and Y by 0 DX(1) = 1, DY(1) = 0
SouthEast call direction 2, DX(2) = 1, DY(2) = 1 AKA diagonal down to the right
South call direction 3, DX(3) = 0, DY(3) = 1 AKA down vertically
SouthWest call direction 4, DX(4) = -1, DY(4) = 1 AKA diagonal down to left
...
DX(1) = 1 : DY(1) = 0
DX(2) = 1 : DY(2) = 1
DX(3) = 0 : DY(3) = 1
DX(4) = -1 : DY(4) = 1
DX(5) = -1 : DY(5) = 0
DX(6) = -1 : DY(6) = -1
DX(7) = 0 : DY(7) = -1
DX(
= 1 : DY(
= -1 (well I guess the forum editor thinks the NE direction is cool!)
There's a good chunk of the code done for you now!
Now there is another challenge, find the words by rotating and/or reflecting the grid of letters. Sound like fun?
Eh, probably not for Beginner's ASIC.
Ha! maybe only B+ thinks that might be fun?