mapIndexedToSudokuBoard

inline fun <T> String.mapIndexedToSudokuBoard(dimension: Dimension, crossinline valueMapper: (value: Int, row: Int, column: Int) -> T): List<List<T>>

Converts a string representation of a Sudoku board to a two-dimensional list of custom elements, allowing access to row and column indices during mapping.

Receiver

The string representing the Sudoku board.

Return

A two-dimensional list of custom elements representing the Sudoku board, where each cell is decoded and mapped using the provided valueMapper, incorporating its row and column indices.

Parameters

dimension

The type of Sudoku board (e.g., 4x4, 9x9), used to determine the size and structure of the board.

valueMapper

A function that maps each integer value in the string representation to a custom element, additionally providing the row and column indices of the cell.

See also