Add tests
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
package domain
|
||||
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
|
||||
sealed class Clue {
|
||||
abstract fun isRuleViolated(grid: Grid): Boolean
|
||||
var isActive: Boolean by mutableStateOf(true)
|
||||
}
|
||||
|
||||
sealed class HorizontalClue : Clue()
|
||||
@@ -58,6 +53,10 @@ class TripletClue<C : ItemClass<C>>(val a: Item<C>, val b: Item<C>, val c: Item<
|
||||
val rowC = grid[cType.companion]
|
||||
|
||||
for (i in 2 until grid.size) {
|
||||
if (rowA[i-2].selection == a){
|
||||
return rowB[i - 1].mayBe(b) &&
|
||||
rowC[i - 0].mayBe(c)
|
||||
}
|
||||
if (rowA[i - 2].mayBe(a) &&
|
||||
rowB[i - 1].mayBe(b) &&
|
||||
rowC[i - 0].mayBe(c)
|
||||
|
||||
Reference in New Issue
Block a user