Tag Info

Hot answers tagged

10

Imagine the following setup: 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 1 1 1 1 As a side note, I refer to squares in the matrix like this: (row, column). I've represented mines with "1" and empty spaces with "0". Assume the user clicks on the empty space at (2, 2) (the corner at the top-left is (0, 0)). This is what would happen: ...


7

I can't tell from your (lack of) code, but you are probably just missing a stop to make sure that you don't handle tiles which have already been handled. At the top of the function you should put something like: if(thistile.hasbeenhandled){ return; } else{ thistile.hasbeenhandled=true; } Otherwise any two adjacent tiles that are to display empty ...


4

eBuisiness's answer is correct. But you're setting the HasBeenHandled flag after trying to update all the neighbors which then causes a stack overflow. You should instead set the flag before doing anything else. EDIT: You've also made typos in the if statements. if (Bottom.btn != null) set_text_of_button(Bottom.btn); if (Bottom_Left.btn != null) ...


3

The 3BV score is essentially counting the number of clicks required to reveal all non-mine squares. A Minesweeper board is essentially an m*n array. To calculate the 3BV, you will need to process the cells in this array in a particular order, so you will need to be able to mark each cell after you process it (so you don't process it multiple times). Then, ...


1

glViewport(0, 0, width, height); // reset the viewport glMatrixMode(GL_PROJECTION); // modify the projection matrix glLoadIdentity(); // load an identity matrix into the projection matrix glOrtho(0, width, 0, height, -1.0, 1.0); // create new projection matrix /// Important!!! You need to switch back to the model-view matrix /// or else your ...



Only top voted, non community-wiki answers of a minimum length are eligible