What algorithm to apply in minesweeper game's first turn ?

I am creating 3D minesweeper and kind of stuck at this : How exactly the things work after the user clicks the first cell. I know that first cell needs to be a non-bomb cell. As we know, when we play classic Microsoft’s minesweeper, we click any cell in the whole field and it creates kind-of chain reaction and opens other adjacent cells. Now, what is the criteria for this ? How many cells will be opened ? Is there any specific number ?

Going from memory of how this game works.

The board is known ahead of time, right? For each cell you have already calculated the number of bombs adjacent to that cell so this is known.

So for each cell adjacent to the initial cell you must check to see if that cell has any adjacent bombs. If it doesn’t, i.e. the bomb adjacency number is zero, then it is revealed immediately as being zero. That cell itself must then be checked in the same way as if it were clicked because it is now an open safe cell… and the same for any new open cells which it encounters. If it does have a number, that number is revealed. And so on.

Sounds like recursion homework :slight_smile: