示例#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());
        }