Ejemplo n.º 1
0
        public static (int all, int quietOnly) CountTilesReachedByWater(string[] input)
        {
            var mapBuilder = new MapBuilder();

            foreach (var scan in input)
            {
                mapBuilder.AddClaySegment(scan);
            }

            var map = mapBuilder.Build();

            Console.WriteLine("Before:\n" + map.Draw());
            map.SimulateWaterFlow();
            Console.WriteLine("\nAfter:\n" + map.Draw());

            return(map.CountTilesReachedByWater());
        }