Improve domain (WIP)

This commit is contained in:
2024-06-11 23:41:39 +02:00
parent f891dea885
commit 60204f3b04
6 changed files with 122 additions and 44 deletions

View File

@@ -0,0 +1,15 @@
package domain
fun generateGame(): Game {
// Here's a simple algorithm making use of your solver:
// 1. Generate a random puzzle instance.
// 2. Build a set C of all possible clues that pertain to this puzzle instance. (There are a finite and in fact quite small number of possible clues: for example if there are 5 houses, there are 5 possible clues of the form "Person A lives in house B", 8 possible clues of the form "Person A lives next to house B", and so on.)
// 3. Pick a random permutation c1, c2, ..., cn of the clues in C.
// 4. Set i = 1.
// 5. If i > n, we are done. The set C of clues is minimal.
// 6. Let D = C { ci }. Run your solver on the set D of clues and count the number of possible solutions.
// 7. If there is exactly one solution, set C = D.
// 8. Set i = i + 1 and go back to step 5.
// (You can speed this up by removing clues in batches rather than one at a time, but it makes the algorithm more complicated to describe.)
TODO()
}