flutter_2048
flutter_2048 copied to clipboard
Fixed #1: The game stops working when the board is full
After inspecting the code, I found this function was the cause.
https://github.com/angjelkom/flutter_2048/blob/ca1c660f5e737ee51fb4259130b08c7677c62433/lib/managers/board.dart#L140-L148
The loop is endless when the indexes
gets all 16 numbers.
And based on this algorithm, the probability of generating tiles at each location is not.