Render puzzle (WIP)

This commit is contained in:
Christian Basler
2024-06-20 17:37:06 +02:00
parent fcbebe802f
commit 1248288e98
10 changed files with 70 additions and 23 deletions

View File

@@ -1,5 +1,7 @@
package domain
import androidx.compose.ui.util.fastAny
class Game(
val grid: Grid,
val clues: List<Clue>
@@ -18,7 +20,6 @@ class Game(
gameCell.options.remove(position.item)
}
}
}
}
@@ -34,6 +35,5 @@ class Game(
}
fun areRulesViolated(): Boolean = clues
.map { it.isRuleViolated(grid) }
.reduce { a, b -> a || b }
.any { it.isRuleViolated(grid) }
}