pub enum SudokuParseError {
WrongNumberOfParts,
WrongNumberOfCells,
MalformedDimensions,
InvalidDimensions,
NumberFormatError,
InvalidNumber,
}
Expand description
An enumeration of the errors that may occur when parsing a Sudoku or SudokuGrid.
Variants§
WrongNumberOfParts
Indicates that the code has the wrong number of parts, which are separated by semicolons. The code should have two parts: dimensions and cells (separated by ‘;’), so if the code does not contain exactly one semicolon, this error will be returned.
WrongNumberOfCells
Indicates that the number of cells (which are separated by commas) does not equal the number deduced from the dimensions.
MalformedDimensions
Indicates that the dimensions have the wrong format. They should be of
the form <block_width>x<block_height>
, so if the amount of ’x’s in
the dimension string is not exactly one, this error will be raised.
InvalidDimensions
Indicates that the provided dimensions are invalid (i.e. at least one is zero).
NumberFormatError
Indicates that one of the numbers (dimension or cell content) could not be parsed.
InvalidNumber
Indicates that a cell is filled with an invalid number (0 or more than the grid size).