Hi, I'm new to programming and I'm trying to create a minesweeper program. At the moment it's a bit of a mess but I thought I'd tidy it up once it worked properly. Also I haven't randomly allocated the mines yet.
The problem I'm having is in the function calcSurrounding, the if statement never evaluates to true so the surrounging mines stays at 0. Does anyone know why this is? Thanks for any help.
Sorry I've figured it out now. The co-ordinates were the wrong way around. Some constructive criticism on the program so far would really help thought.
When you call calc surrounding, you need to refer to the coordinates as (x-1, y-1) because of the way arrays are referenced.
If they choose (1, 1), the array equivalent should be (0, 0).