Package-level declarations

Types

Link copied to clipboard
data class BoxCoordinates(val topLeftRow: Int, val topLeftCol: Int, val bottomRightRow: Int, val bottomRightCol: Int)

Data class representing the coordinates of a box in a Sudoku grid.

Link copied to clipboard
data class CellCoordinates(val row: Int, val col: Int)

Data class representing the coordinates of a cell in a Sudoku grid.

Link copied to clipboard

Represents the difficulty levels of Sudoku puzzles.

Link copied to clipboard

Exception thrown when a difficulty label cannot be found because the index is out of bounds.

Link copied to clipboard
sealed class Dimension

Sealed class representing different Sudoku dimensions with varying grid sizes.

Link copied to clipboard

Exception thrown when an invalid seed value is provided.

Link copied to clipboard
sealed class Seed : Comparable<Seed>

Represents a seed value for generating randomization in various contexts.

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

Checks if the given cell coordinates are within this box.

Link copied to clipboard
fun createSeed(value: Long): Seed

Creates a new Seed object with the specified value, representing an explicit seed.

Link copied to clipboard
fun Dimension(digitCount: Int): Dimension

Creates a Dimension instance based on the provided digit count.

Link copied to clipboard
fun BoxCoordinates.expand(rowExpansion: Int, colExpansion: Int): BoxCoordinates

Expands the box by the specified number of rows and columns.

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

Computes the intersection of this box with another BoxCoordinates instance.

Link copied to clipboard

Determines if the box should have a darker background color.

Link copied to clipboard

Determines if the cell should have an alternate style, such as a different color.

Link copied to clipboard

Checks if the box is in the bottom-right corner of the Sudoku grid.

Checks if the cell is in the bottom-end corner of the Sudoku grid.

Link copied to clipboard

Checks if the box is in the bottom-left corner of the Sudoku grid.

Checks if the cell is in the bottom-start corner of the Sudoku grid.

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

Checks if the box is in the top-right corner of the Sudoku grid.

Checks if the cell is in the top-end corner of the Sudoku grid.

Link copied to clipboard

Checks if the box is in the top-left corner of the Sudoku grid.

Checks if the cell is in the top-start corner of the Sudoku grid.

Link copied to clipboard

Converts the box coordinates to a human-readable string representation.

Link copied to clipboard

Converts the difficulty level to a string representation using the provided difficulty labels.

Link copied to clipboard

Creates a new Seed object from this Long value, representing an explicit seed.

Link copied to clipboard

Converts the difficulty level to a string representation using stars.