Its goal is to transpose sudokus in a non-destructive way to generate more variants while maintaining the same grade.
The mutations already implemented are:
- swapping rows (within a band)
- swapping columns (within a stack)
- swapping stacks
- swapping bands
- rotate clockwise
- shuffle the numbers
- Code: Select all
var builder = new Builder()
.Shuffle("123456")
.Stack(0).Swap(1)
.Stack(0).Mirror()
.Stack(0).Shuffle()
.Stacks().Mirror()
.Stacks().ForEach(stack => stack.Mirror())
.Bands().ForEach(band => band.Mirror())
.Band(0).Swap(1)
.Band(0).Mirror()
.Bands().Mirror()
.Rotate();
Grid starter = "000200040030004001100600050060002000";
_output.WriteLine(builder.Apply(starter).ToString());
Grid solution = "513246246135624351135624351462462513";
_output.WriteLine(builder.Apply(solution).ToString());
- Code: Select all
000600050002000130302000010004006000
564231413652632514325146156423241365