Question: Write a function USING MATLAB that helps solve word search puzzles. Your function should search a 2-dimensional array of characters to find a specified word.

Write a function USING MATLAB that helps solve word search puzzles. Your function should search a 2-dimensional array of characters to find a specified word. If the word is found, the function should return the indices of the first character of the word and the direction of the word in the puzzle (e.g. across, down, diagonals, and their reverses). If the word is not found, the function should return values indicating that fact, such as -1 for all return values.

Example: Suppose you are given the following puzzle

Command window should look like this

>> [row,column,direction] = wordsearch(puzzle,algorithm)

row = 1

column = 4

direction =

across (left to right)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!