Recursive Functions

I’ve written a basic minesweeper game in Flash. When you click a blank square, it blanks all the squares around it, then uses a recursive function to do the same to any blank square relative to it. But I want my game to be able to have a grid of 20x30, and with say 15 mines, but the recursive function runs more than 256 times most of the time with those settings, and therefor Flash thinks it’s an infinite loop (which it’s not) and cancels everything.

Is there another way to go about doing this?

You should try going at it row by row, not all the rows together. That way you are only checking lets say 20 or 30 at a time and then moving to the next row.

sounds like sloppy coding as well, although I’ve never made a game

check out the game section