Пример #1
0
        public static void Main(string[] args)
        {
            var solver = new LakeCounter (new string[]{ "W" });
            Console.WriteLine (solver.count ());
            solver = new LakeCounter (new string[]{
                "W........WW.",
                ".WWW.....WWW",
                "....WW...WW.",
                ".........WW.",
                ".........W..",
                ".........W..",
                "..W......W..",
                ".W.W.....WW.",
                "W.W.W.....W.",
                ".W.W......W.",
                "..W.......W."});
            Console.WriteLine (solver.count ());

            solver = new LakeCounter (new string[]{
                "W........WW.",
                ".W.W.....WWW",
                "....WW...WW.",
                ".........WW.",
                ".........W..",
                ".........W..",
                "..W.........",
                ".W.W.....WW.",
                "W.W.W.....W.",
                ".W.W......W.",
                "..W.......W."});
            Console.WriteLine (solver.count ());
        }
Пример #2
0
        public static void Main(string[] args)
        {
            var solver = new LakeCounter(new string[] { "W" });

            Console.WriteLine(solver.count());
            solver = new LakeCounter(new string[] {
                "W........WW.",
                ".WWW.....WWW",
                "....WW...WW.",
                ".........WW.",
                ".........W..",
                ".........W..",
                "..W......W..",
                ".W.W.....WW.",
                "W.W.W.....W.",
                ".W.W......W.",
                "..W.......W."
            });
            Console.WriteLine(solver.count());

            solver = new LakeCounter(new string[] {
                "W........WW.",
                ".W.W.....WWW",
                "....WW...WW.",
                ".........WW.",
                ".........W..",
                ".........W..",
                "..W.........",
                ".W.W.....WW.",
                "W.W.W.....W.",
                ".W.W......W.",
                "..W.......W."
            });
            Console.WriteLine(solver.count());
        }