Beispiel #1
0
        private Dictionary <String, List <Vector2> > FindAllWordLocations(WordSearchPuzzle puzzle)
        {
            DirectionSearchFactory directionSearchFactory = new DirectionSearchFactory(puzzle);
            WordSearchAlgorithm    algorithm = new WordSearchAlgorithm(directionSearchFactory, puzzle.WordsList);

            return(algorithm.SearchEachWord());
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public WordsLocationFinder(WordSearchPuzzle puzzle)
 {
     wsPuzzle = puzzle;
 }