Mines 2.0 Gremlins
As soon as the Mines update appeared on the App Store, it immediately started picking up one-star reviews like a horrible Katamari of failure. Some of them mentioned a bug that I knew about, where the timer sometimes wouldn't appear, but some mentioned a much uglier problem: there were no mines. That made no sense to me at all until a helpful comment here from Adam Wilcox, who sent me some screenshots that definitely showed mines (and their surrounding numbers) disappearing from the board as they were tapped.
I recognized that as a misapplication of the code I added to prevent the player from losing on the first move of the game; if you haven't opened up any of the board, and the first cell you touch is a mine, the game quietly removes that mine and acts as if there was empty space there all along. It sounded like that was somehow continuing to happen after the first move: the game simply wouldn't let you lose.
GDB came to the rescue, as it so often does: it informed me that a certain variable—the board view's “did that move just lose the game” value—was getting optimized away by the compiler in the Release build. As it turns out, I never initialized it, only set it to YES if a touch landed on a mine; the issue never came up in my testing because I always used the Debug configuration, in which, it appears, the compiler doesn't do that kind of meddling.
Lesson learned: test using the Release configuration. Mines is off the Store for the moment; I'll submit an update to Apple later today that'll fix the problem.
1 Comments:
Happy to help.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home