processGridMistakes
inline fun <T> List<List<T>>.processGridMistakes(mistakesMethod: MistakeCheckingMode, dimension: Dimension, crossinline getValue: (T) -> Int, crossinline isLocked: (T) -> Boolean, crossinline getSolution: (T) -> Int, crossinline isError: (T) -> Boolean, crossinline updateCell: (row: Int, col: Int, SudokuCellState, T) -> T): List<List<T>>
Converts the grid to SudokuCellState
, checks for mistakes, and converts it back to the original grid type.
Return
The updated grid with potential mistake annotations.
Parameters
T
The type of the user grid cells.
mistakesMethod
The method used to check for mistakes.
dimension
The dimension used for Sudoku rules.
getValue
Lambda function to get the value of a cell from the original type.
isLocked
Lambda function to determine if a cell is locked.
getSolution
Lambda function to get the solution value of a cell from the original type.
isError
Lambda function to determine if a cell has an error state.
updateCell
Lambda function to update a cell in the original grid type.