예제 #1
0
        public override string Part1(string input)
        {
            var puzzleSolver = new PuzzleSolver();

            puzzleSolver.ParseInput(input);

            if (Debugger.IsAttached)
            {
                puzzleSolver.WriteDebugChecksums();
            }

            puzzleSolver.FindMatchingTiles();

            return(puzzleSolver.CalculateProductOfCornerTileIDs().ToString());
        }
예제 #2
0
        public override string Part2(string input)
        {
            var puzzleSolver = new PuzzleSolver();

            puzzleSolver.ParseInput(input);

            if (Debugger.IsAttached)
            {
                puzzleSolver.WriteDebugChecksums();
            }

            puzzleSolver.FindMatchingTiles();

            if (Debugger.IsAttached)
            {
                puzzleSolver.WriteDebugMatches();
            }

            puzzleSolver.StartPuzzling();

            int countSeaMonsters = puzzleSolver.CountSeaMonsters();

            return(countSeaMonsters.ToString());
        }