On Fri, Jun 2, 2017 at 5:30 PM, George Rimakis <[email protected]> wrote:

> Hi,
>
> I'll need to look at the code again, but I believe the entire playfield I
> stored in a matrix array.
>
> I also declared two arrays(long enough to represent every cell) to act as
> a stack(sort of). There are two counting integers also, for Read and Write.
> When you check a cell, it marks the cell as "Checked". It then stores the x
> and y positions of the cell to the X and Y stack arrays. Finally it
> increments the Write count.
>
> Then it goes to the actual "checking" part of the program. If Read<Write,
> that means we have some cells that need to be checked. It fetches the X and
> Y from the stack(position comes from Read variable). Then the Read count is
> incremented by one.
>
> It does the actual revealing of the cell here. If there are mines it shows
> the number of mines nearby. If there are no mines, it adds each neighboring
> cell to the stack(if the cell hasnt already been checked). Then it goes
> back to the check. It will continue on until Read=Write. When Read=Write,
> we know that the stack has no unchecked cells in it, and control is
> returned to the player.
>
> I can go in on Sunday and comment the code if you'd like. There are
> already some comments explaining which cells are being checked, but they
> are very limited.
>
>
Thanks! That should help, I'll let you know if I cannot figure it out.

BASIC code can be a little obtuse no matter how hard we try...

-- John.

Reply via email to