private Dictionary <String, List <Vector2> > FindAllWordLocations(WordSearchPuzzle puzzle) { DirectionSearchFactory directionSearchFactory = new DirectionSearchFactory(puzzle); WordSearchAlgorithm algorithm = new WordSearchAlgorithm(directionSearchFactory, puzzle.WordsList); return(algorithm.SearchEachWord()); }
static void Main(string[] args) { PuzzleFileParser solver = new PuzzleFileParser(); WordSearchPuzzle puzzle = solver.ParseFileToWordSearchPuzzle(args[0]); WordsLocationFinder wordsFinder = new WordsLocationFinder(puzzle); WordsMapDecorator wordsMap = wordsFinder.GetWordsMap(); Console.WriteLine(wordsMap.ToString()); }
public WordSearchPuzzle ParseFileToWordSearchPuzzle(String fileName) { puzzle = new WordSearchPuzzle(); String[] lines = File.ReadAllLines(fileName); ParseWordsIntoPuzzle(lines[WORD_ROW_INDEX]); String[] rawLetters = new String[lines.Length - NUMBER_OF_WORD_ROWS]; Array.Copy(lines, LETTER_ROW_FIRST_INDEX, rawLetters, MIN_DIMENSION_INDEX, lines.Length - NUMBER_OF_WORD_ROWS); ParseLettersIntoPuzzle(rawLetters); return(puzzle); }
public WordsLocationFinder(WordSearchPuzzle puzzle) { wsPuzzle = puzzle; }