SudokuLayoutManipulator

Interface for manipulating Sudoku layouts.

This interface defines methods for creating a base Sudoku layout, shuffling it, and rotating it. Implementations of this interface are expected to handle the generation of Sudoku grid layouts and apply transformations to modify them. The companion object provides a default implementation with basic shuffling and rotation capabilities.

Example Usage:

val boxDigits = 9
val random = Random(1234)
val manipulator = SudokuLayoutManipulator.default(boxDigits, random)

val baseLayout = manipulator.constructBase()
val shuffledLayout = manipulator.shuffle(baseLayout)
val rotatedLayout = manipulator.rotate(shuffledLayout)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun constructBase(): Layout

Constructs the base Sudoku layout based on the specified size.

Link copied to clipboard
abstract fun rotate(layout: Layout): Layout

Rotates the given Sudoku layout by a random multiple of 90 degrees.

Link copied to clipboard
abstract fun shuffle(layout: Layout): Layout

Shuffles the given Sudoku layout by applying a series of transformations.