Esempio n. 1
0
        static void Main(string[] args)
        {
            int           n     = int.Parse(Console.ReadLine());
            List <string> words = new List <string>();

            for (int i = 0; i < n; i++)
            {
                words.Add(Console.ReadLine());
            }
            string[] inputs = Console.ReadLine().Split(' ');
            int      h      = int.Parse(inputs[0]);
            int      w      = int.Parse(inputs[1]);

            string[] lines = new string[h];
            for (int i = 0; i < h; i++)
            {
                lines[i] = Console.ReadLine();
            }

            WordGrid   grid   = new WordGrid(w, h, lines);
            WordFinder finder = new WordFinder(words, grid);

            // Write an action using Console.WriteLine()
            // To debug: Console.Error.WriteLine("Debug messages...");

            Console.WriteLine(finder.Find());
        }
Esempio n. 2
0
 public WordFinder(List <string> list, WordGrid grid)
 {
     _grid  = grid;
     _words = list;
 }