Add tests

This commit is contained in:
Christian Basler
2024-06-21 19:54:15 +02:00
parent abe163d09f
commit a598218cf2
7 changed files with 194 additions and 36 deletions

View File

@@ -56,14 +56,16 @@ class TripletClue<C : ItemClass<C>>(val a: Item<C>, val b: Item<C>, val c: Item<
val ib = grid.indexOf(bType)
val ic = grid.indexOf(cType)
if (ib == 0 || ib == grid.size) {
return true
}
if (ia == -1 && ic == -1) {
return false
}
if (ia != -1 && ic != -1) {
if (ia + 2 == ic || ia == ic + 2) {
return true
}
return !(ia + 2 == ic || ia == ic + 2)
}
if (isNeighbourRuleViolated(ia, ib) || isNeighbourRuleViolated(ib, ic)) {