Class WordSearchSolver

java.lang.Object
  extended by WordSearchSolver

public class WordSearchSolver
extends java.lang.Object

Word Search Puzzle Solver. Finds the words in a word search puzzle, given the puzzle and a list of words

Author:
J.Dalbey

Constructor Summary
WordSearchSolver(int size, char[][] puzzleboard, java.util.ArrayList<java.lang.String> words)
          Construct a Word Search puzzle solver.
 
Method Summary
 java.util.ArrayList<PuzzleWord> findwords()
          Find the location of words hidden in a puzzle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordSearchSolver

public WordSearchSolver(int size,
                        char[][] puzzleboard,
                        java.util.ArrayList<java.lang.String> words)
Construct a Word Search puzzle solver.

Parameters:
size - dimension of puzzle, i.e., the length of a row
puzzleboard - a 2D grid of letters in the puzzle, starting at position [1,1]. The first row and first column of the array are unused.
words - the list of words to find in the puzzle
Precondition:
the puzzle is a square, the letters in the puzzle are all uppercase., the words in the list have no embedded blanks
Method Detail

findwords

public java.util.ArrayList<PuzzleWord> findwords()
Find the location of words hidden in a puzzle.

Returns:
a list of PuzzleWords that contains all found words and their locations. The found words are in the same order as the list provided to the constructor.