I’m having trouble figuring out how to accomplish the following, as maths isn’t my strong point. What I’m trying to do is making a chain reaction by using a search algorithm which would work in the following way: The player places a bomb on a grid-system. Then I want to search every 3x3 positions surrounding the bomb for additional bombs. If one or more bombs are discovered by the search, these should then be added to a table. Then the search will continue with focus on the newly discovered bombs in a 3x3 grid around these (not counting the already discovered bombs) to check for more bombs, continuing to add these to the table until there are no further bombs to be found. Finally my intention is to call a function which will destroy all the grid-positions stored in the table.
Any help, alternative solutions, code, pseudo-code or links to information on the topic would be greatly appreciated!
[import]uid: 129287 topic_id: 25041 reply_id: 325041[/import]