BoxCoordinates

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.

This class encapsulates the details of a rectangular box within a Sudoku grid, defined by its top-left and bottom-right coordinates. It provides additional properties to easily access the dimensions of the box and its corner coordinates.

Constructors

Link copied to clipboard
constructor(topLeftRow: Int, topLeftCol: Int, bottomRightRow: Int, bottomRightCol: Int)

Properties

Link copied to clipboard

Gets the coordinates of the bottom-right cell of the box as a tuple.

Link copied to clipboard

The column index of the bottom-right cell in the box.

Link copied to clipboard

The row index of the bottom-right cell in the box.

Link copied to clipboard
val height: Int

Computes the height of the box, which is the number of rows spanned by the box.

Link copied to clipboard

Gets the coordinates of the top-left cell of the box as a tuple.

Link copied to clipboard

The column index of the top-left cell in the box.

Link copied to clipboard

The row index of the top-left cell in the box.

Link copied to clipboard
val width: Int

Computes the width of the box, which is the number of columns spanned by the box.

Functions

Link copied to clipboard

Checks if the given cell coordinates are within this box.

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

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

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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