diff --git a/src/Sudoku.Console/BulkSolver.cs b/src/Sudoku.Console/BulkSolver.cs index 83a6b10..a2e0ad4 100644 --- a/src/Sudoku.Console/BulkSolver.cs +++ b/src/Sudoku.Console/BulkSolver.cs @@ -76,7 +76,7 @@ public void Solve(bool quiet = false, bool noSummary = false) var clues = _puzzles[i].Clues; - if (! _timings.TryGetValue(clues, out (int Count, double Elapsed) value)) + if (! _timings.TryGetValue(clues, out var value)) { value = (0, 0); @@ -126,7 +126,7 @@ public void Solve(bool quiet = false, bool noSummary = false) var clues = _puzzles[i].Clues; - if (! _timings.TryGetValue(clues, out (int Count, double Elapsed) value)) + if (! _timings.TryGetValue(clues, out var value)) { value = (0, 0); diff --git a/src/Sudoku.Console/TreeGenerator.cs b/src/Sudoku.Console/TreeGenerator.cs index 1205f8b..9e5c6cc 100644 --- a/src/Sudoku.Console/TreeGenerator.cs +++ b/src/Sudoku.Console/TreeGenerator.cs @@ -167,7 +167,7 @@ private static Node GenerateNodes(int[] puzzle, SudokuResult result) var root = node; - Node solved = node; + var solved = node; var backtracking = false; diff --git a/src/Sudoku/Generator.cs b/src/Sudoku/Generator.cs index ec1aae6..e3b1dc4 100644 --- a/src/Sudoku/Generator.cs +++ b/src/Sudoku/Generator.cs @@ -81,12 +81,7 @@ private bool CreateSolvedPuzzle(Span puzzle, int cell = 0) if (puzzle.IsValidSudoku()) { - if (cell == 80) - { - return true; - } - - return CreateSolvedPuzzle(puzzle, cell + 1); + return cell == 80 || CreateSolvedPuzzle(puzzle, cell + 1); } } diff --git a/src/Sudoku/Solver.cs b/src/Sudoku/Solver.cs index 1fec1a5..4e6515e 100644 --- a/src/Sudoku/Solver.cs +++ b/src/Sudoku/Solver.cs @@ -79,7 +79,7 @@ public SudokuResult Solve(int[] puzzle) return new SudokuResult(_workingCopy, false, _steps, stopwatch.Elapsed.TotalMicroseconds, null, null, $"Insufficient number of clues: {81 - _score}"); } - _history = _historyType != HistoryType.None ? new List() : null; + _history = _historyType != HistoryType.None ? [] : null; var candidates = GetSectionCandidates(span);