Open JFed-9 opened 2 years ago
any idea how to fix this?
To be honest, I haven't had a lot of time to go over your code (which is impressively concise and elegant by the way). But if I were to guess, it has something to do with the flagging/revealing functions. The win check is fine, it should work as expected. But just now as I was testing, I had another experience where there was one mine and one free space left, I flagged the free space and unflagged a random mine, and it decided to click the unrevealed mine and lose the game. I can't quite put my finger on it, but the flagging/revealing functions are what I would look into.
I'll attach a screenshot. I was guessing where the last two mines could be, got one right and one wrong. As I was clicking through the safe tiles, it said I finished the game, but one of my flags was incorrect. If you look closely at the bottom right, there's a 3 with 4 flags next to it. The flag should be on the box below it.