SudokuSchemas
Represents a set of Sudoku schemas.
This class encapsulates a collection of SudokuSchema objects. It allows iteration over the schemas, copying the set with modified schemas, and provides standard methods for equality and string representation.
Example:
val schema1 = SudokuSchema(
puzzle = SudokuString("A1B2..."),
solution = SudokuString("1A2B..."),
difficulty = Difficulty.MEDIUM,
sudokuType = SudokuType.Sudoku4x4
)
val schema2 = SudokuSchema(
puzzle = SudokuString("B1C2..."),
solution = SudokuString("2B3C..."),
difficulty = Difficulty.HARD,
sudokuType = SudokuType.Sudoku4x4
)
// Create a SudokuSchemas with the schemas
val schemaSet = SudokuSchemas(listOf(schema1, schema2))
// Iterate over the schemas
for (schema in schemaSet) {
println(schema)
}
// Create a copy of the schema set
val copiedSchemaSet = schemaSet.copy()
See also
Constructors
Creates a new instance of SudokuSchemas with the provided list of schemas.
Types
Builder class for constructing a SudokuSchemas with a DSL-style configuration.
Properties
Functions
Checks if the specified SudokuSchema is present in the collection.
Checks if all specified SudokuSchema instances are present in the collection.
Creates a copy of this SudokuSchemas with an optional new list of schemas.
Counts the number of schemas for each difficulty level.
Compares this SudokuSchemas to another object for equality.
Finds all SudokuSchema instances with the specified difficulty.
Finds all SudokuSchema instances with the specified Sudoku dimension.
Filters the schemas by difficulty.
Filters the schemas by size (dimension).
Gets all unique Sudoku dimensions present in this set.
Computes a hash code for this SudokuSchemas.
Returns an iterator over the SudokuSchema objects in this set.
Adds a single SudokuSchema to this SudokuSchemas collection.
Adds another SudokuSchemas collection to this SudokuSchemas collection.
Adds a collection of SudokuSchema objects to this SudokuSchemas collection.
Requires that there are Sudoku schemas for the given difficulty.
Requires that there are Sudoku schemas for the given type.
Converts this SudokuSchemas instance into a Builder object.
Returns a string representation of this SudokuSchemas.