pub fn new_standard(size: usize) -> Result<Rules, NonSquareError> {
        // This makes me a little uncomfortable, but at least
        // it shouldn't be a problem for reasonable sizes.
        let zone_size = (size as f64).sqrt().ceil() as usize;
        if zone_size * zone_size == size {
            Ok(Self::new(RegularCliquesIterator::new(zone_size, zone_size)))
        } else {
            Err(NonSquareError{ size: size })
        }
    }
/// Creates a new set of standard sudoku rules.
///
/// Given a grid `size` that has an integer square root, this creates a set of standard
/// sudoku rules (two cells must differ if they share a row, column or zone), with each
/// zone being a square. For example classic sudoku rules can be created with
/// `Rules::new_standard(9)`. However, if classic sudoku rules cannot be created for a
/// grid of the given `size` (due to lacking an integer square root), an
/// `Err(NonSquareError {...})` is returned instead of an `Ok(Rules {...})`.
Creates a new set of standard sudoku rules.
Given a grid `size` that has an integer square root, this creates a set of standard
sudoku rules (two cells must differ if they share a row, column or zone), with each
zone being a square. For example classic sudoku rules can be created with
`Rules::new_standard(9)`.
Creates a new set of standard sudoku rules . Given a grid ` size ` that has an integer square root this creates a set of standard sudoku rules ( two cells must differ if they share a row column or zone ) with each zone being a square . For example classic sudoku rules can be created with ` Rules :: new_standard ( 9 ) ` .
pub fn new_standard(size: usize) -> Result<Rules, NonSquareError> {
        // This makes me a little uncomfortable, but at least
        // it shouldn't be a problem for reasonable sizes.
        let zone_size = (size as f64).sqrt().ceil() as usize;
        if zone_size * zone_size == size {
            Ok(Self::new(RegularCliquesIterator::new(zone_size, zone_size)))
        } else {
            Err(NonSquareError{ size: size })
        }
    }
pub fn new_standard ( size : usize ) -> Result < Rules , NonSquareError > { // This makes me a little uncomfortable, but at least // it shouldn't be a problem for reasonable sizes. let zone_size = ( size as f64 ) . sqrt ( ) . ceil ( ) as usize ; if zone_size * zone_size == size { Ok ( Self :: new ( RegularCliquesIterator :: new ( zone_size , zone_size ) ) ) } else { Err ( NonSquareError { size : size } ) } }
Creates a new set of standard sudoku rules.
Creates a new set of standard sudoku rules .
size
usize
size
usize