Enhance postcard puzzles and narration
This commit is contained in:
+18
-2
@@ -195,6 +195,20 @@ void main() {
|
||||
}
|
||||
}
|
||||
});
|
||||
test('new 7x7 generated boards retain their grade, uniqueness and deterministic clues', () {
|
||||
for (final d in Difficulty.values) {
|
||||
for (var seed = 1000001; seed < 1000031; seed++) {
|
||||
final p = Puzzle.generateSeven(BigInt.from(seed), d);
|
||||
final repeat = Puzzle.generateSeven(BigInt.from(seed), d);
|
||||
expect(p.size, 7);
|
||||
expect(p.difficulty, d);
|
||||
expect(p.countSolutions(), 1);
|
||||
expect(LogicSolver(49, p.constraints).analyze(p.initial).solved, true);
|
||||
expect(p.solution, repeat.solution);
|
||||
expect(p.given, repeat.given);
|
||||
}
|
||||
}
|
||||
});
|
||||
test(
|
||||
'area solver matches exhaustive enumeration for 300 random small systems',
|
||||
() {
|
||||
@@ -350,7 +364,8 @@ void main() {
|
||||
final store = Progress.memory(), g = Game(await Book.load(), store);
|
||||
g.startDaily(DateTime(2026, 10, 31));
|
||||
final p = g.puzzle!;
|
||||
for (var i = 0; i < 25; i++) {
|
||||
expect(p.size, 7);
|
||||
for (var i = 0; i < p.solution.length; i++) {
|
||||
while (g.cells[i] != (p.solution[i] == 1 ? 1 : 2)) {
|
||||
g.mark(i);
|
||||
}
|
||||
@@ -363,7 +378,8 @@ void main() {
|
||||
await g.startPractice();
|
||||
expect(g.puzzle!.difficulty, Difficulty.hard);
|
||||
final hard = g.puzzle!;
|
||||
for (var i = 0; i < 25; i++) {
|
||||
expect(hard.size, 7);
|
||||
for (var i = 0; i < hard.solution.length; i++) {
|
||||
while (g.cells[i] != (hard.solution[i] == 1 ? 1 : 2)) {
|
||||
g.mark(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user