The program is simple, what you have is a grid of cells. Each cell is a bomb, or a numeric value. Everytime a bomb is placed is a location, 1 is added to all the surrounding cells:<br>
<br>
000<br>
000<br>
000<br>
<br>
BECOMES<br>
<br>
111<br>
1*1<br>
111<br>
<br>
IN A BIGGER PICTURE:<br>
<br>
00111000<br>
112*1000<br>
1*211000<br>
11100000<br>
<br>
So what you have to do is:<br>
<br>
1.) Make a 2d array of type CELL<br>
--CELL is a record with the following values:<br>
*BOMB - Boolean (IS IT A BOMB?)<br>
*VALUE - Integer (HOW MANY BOMBS SURROUND THIS POINT?)<br>
*ACTIVE - Boolean (Must it be shown?[Clicked on etc...])<br>
<br>
2.) Make a filter, which adds 1 to all the CELLS surrounding the BOMB. Make sure it doesn't try to add outside of the grid.<br>
<br>
This sets up you grid of CELLS. From then on it is quite simple!<br>
<br>
Hope this helps u, im sorry I wrote a program in pascal exactly like this but it is at school!<br>
<br>
Sorry,<br>
Cheers,<br>
--DarkMore