TwentyFiveByTwentyFive

Object representing a 25x25 Sudoku dimension.

Properties

Link copied to clipboard

The height of a single box in the grid.

Link copied to clipboard

The width of a single box in the grid.

Link copied to clipboard
val cells: Int
Link copied to clipboard
val digits: Int
Link copied to clipboard

The size of the Sudoku grid (width and height).

Link copied to clipboard
val height: Int

The height of the Sudoku grid.

Link copied to clipboard

Whether the grid size is square (width == height).

Link copied to clipboard

A human-readable name for the Sudoku dimension (e.g., "4x4").

Link copied to clipboard

The total number of cells in the Sudoku grid. This is calculated by squaring the uniqueDigitsCount. Each cell within the grid can hold one of the uniqueDigitsCount distinct digits (or symbols).

Link copied to clipboard

The number of distinct digits used in the Sudoku grid. This represents the total number of unique symbols that can be placed within a single cell of the Sudoku. It is calculated as the product of the grid width and height.

Link copied to clipboard
val width: Int

The width of the Sudoku grid.

Functions

Link copied to clipboard
fun Dimension.areCellsInSameBox(cellIndex1: Int, cellIndex2: Int): Boolean

Checks if two cells are in the same box based on their indices.

fun Dimension.areCellsInSameBox(row1: Int, col1: Int, row2: Int, col2: Int): Boolean

This alternative way to check if two cells are in the same box uses their row and column indices directly.

Link copied to clipboard
fun Dimension.areCellsInSameColumn(cellIndex1: Int, cellIndex2: Int): Boolean

Checks if two cells are in the same column based on their indices.

Link copied to clipboard
fun Dimension.areCellsInSameRow(cellIndex1: Int, cellIndex2: Int): Boolean

Checks if two cells are in the same row based on their indices.

Link copied to clipboard
fun Dimension.areCellsRelated(row1: Int, col1: Int, row2: Int, col2: Int): Boolean

Checks if two cells are related (in the same row, column, or box) based on their row and column indices.

Link copied to clipboard

Returns a list containing all valid digits (1 to Dimension.digits) for the Sudoku.

Link copied to clipboard

Returns the top-left and bottom-right coordinates of the box containing the cell at the specified row and column.

Link copied to clipboard
fun Dimension.getBoxIndex(row: Int, col: Int): Int

Returns the box index (within the range 0 to Dimension.boxes - 1) for a given cell at the specified row and column.

Link copied to clipboard

Returns the box column index (within the range 0 to (Dimension.width - 1 / Dimension.boxWidth - 1)) for a given cell index.

Link copied to clipboard

Returns the box row index (within the range 0 to (Dimension.height - 1 / Dimension.boxHeight - 1)) for a given cell index.

Link copied to clipboard

Returns the column index (within the range 0 to Dimension.width - 1) for a given cell index.

Link copied to clipboard
Link copied to clipboard
fun Dimension.getCellRowIndex(cellIndex: Int): Int

Returns the row index (within the range 0 to Dimension.height - 1) for a given cell index.

Link copied to clipboard

Checks if a given digit is valid within the range of allowed digits for this Sudoku (1 to Dimension.digits).

Link copied to clipboard
override fun toString(): String

Returns a string representation of the Sudoku dimension.