コード例 #1
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());
        }
コード例 #2
0
        public WordsMapDecorator GetWordsMap()
        {
            Dictionary <String, List <Vector2> > wordsLocation = FindAllWordLocations(wsPuzzle);
            WordsMapDecorator wordsMap = new WordsMapDecorator(wordsLocation);

            if (!wordsMap.IsValid())
            {
                throw new InvalidDataException();
            }

            return(new WordsMapDecorator(wordsLocation));
        }