Skip to main content

Module class

Module class 

Source
Expand description

The puzzle-family generator contract.

Sudoku and futoshiki generate by the same three beats — seed a full solution, place clue furniture, then uniqueness-checked hole-dig — and diverge only where PuzzleClass names seams. The trait is the intersection their two generators already satisfy, drawn so one generic dealer can drive both; T4-W13’s generate_by_digging<C: PuzzleClass> is that dealer, and a third family (Thermo/Killer/KenKen) ships as one impl of this trait plus a payload builder, no new generator.

Re-exports§

pub use crate::puzzles::sudoku::rng::SimpleRng;

Traits§

PuzzleClass
The generator contract a puzzle family satisfies so one generic hole-digging dealer deals them all.

Functions§

generate_by_digging
The generic hole-digging dealer, driven entirely through PuzzleClass — the three shared beats every family generates by: seed a full solution, place clue furniture, then dig blanks while a max_solutions: 2 re-solve keeps the board unique (a removal that admits a second solution is reverted). One seeded rng threads seed → clues → dig.