Skip to content

Commit

Permalink
Fix a little bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
KyouyamaKazusa0805 committed Apr 18, 2024
1 parent d93cb58 commit 5358e96
Showing 1 changed file with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,17 @@ out CellMap interferingCells
return GeneratingFailedReason.InvalidData;
}

for (var (i, p) = (0, 0); i < interferingDigitsCount; p++)
for (var i = 0; i < interferingDigitsCount; i++)
{
if (p >= 81)
{
break;
}

var interferingCell = CellSeed[i];
if (puzzle.GetState(interferingCell) == CellState.Modifiable
|| excludedCells.Contains(targetCell)
|| interferingCell == targetCell)
if (puzzle.GetState(interferingCell) != CellState.Modifiable
&& !excludedCells.Contains(interferingCell)
&& interferingCell != targetCell)
{
// Skips the cell that is already given, or is the conclusion cell.
continue;
// Set the value onto the puzzle.
interferingCells.Add(interferingCell);
puzzle.SetDigit(interferingCell, solution.GetDigit(interferingCell));
}

// Set the value onto the puzzle.
interferingCells.Add(interferingCell);
puzzle.SetDigit(interferingCell, solution.GetDigit(interferingCell));
i++;
}
}

Expand Down

0 comments on commit 5358e96

Please sign in to comment.