Added tests (WIP, failing)
This commit is contained in:
@@ -60,8 +60,10 @@ class TripletClue<C : ItemClass<C>>(val a: Item<C>, val b: Item<C>, val c: Item<
|
||||
return false
|
||||
}
|
||||
|
||||
if (ia == ib) {
|
||||
return true
|
||||
if (ia != -1 && ic != -1) {
|
||||
if (ia + 2 == ic || ia == ic + 2) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if (isNeighbourRuleViolated(ia, ib) || isNeighbourRuleViolated(ib, ic)) {
|
||||
|
||||
@@ -32,7 +32,13 @@ fun List<List<Item<ItemClass<*>>>>.toGrid() = Grid(
|
||||
GameRow(
|
||||
category = row.first().itemType.companion,
|
||||
options = row,
|
||||
cells = row.map { GameCell(selection = null, solution = it, options = row.toMutableList()) }
|
||||
cells = row.map {
|
||||
GameCell(
|
||||
selection = null,
|
||||
solution = it,
|
||||
options = row.toMutableList()
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
@@ -48,7 +54,7 @@ class GameCell<C : ItemClass<C>>(
|
||||
|
||||
class Item<C : ItemClass<C>>(
|
||||
val itemType: C,
|
||||
val symbol: String
|
||||
val symbol: String = itemType.symbols.random()
|
||||
) {
|
||||
constructor(itemType: C) : this(itemType, itemType.symbols.random())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user