Closed Zomis closed 2 years ago
This seems to be a feature and not a bug. Or rather, it seems to be intended behavior.
When using randomFromList
, the values gets reversed by removing last and adding to new list:
while (strings.isNotEmpty()) {
val next = strings.removeLast()
val item = remainingList.removeAt(remainingList.indexOfFirst { stringMapper(it) == next })
result.add(item)
}
There is something that ends up being in reverse when it comes to state. For a new game, the following state is stored:
[ "E", "B", "D", "H", "A", "C", "G", "F" ]
But when running the game, it looks to be in the opposite order.
It doesn't matter that much at the moment, as at least it's consistent. But it still feels strange.