Name: Anonymous 2008-11-16 17:37
I have a programming project due tomorrow at midnight and I am supposed to make a minesweeper game using a class.
The game board is 5X5 and should have 5 mines randomly placed on the grid. Basically there will be two grids(one that holds the data for mines and how many mines are near each space, and another that is the players view)which should just be a list of lists. The player view grid should start out showing an 'H' in each spot till they are removed by player input.
Example below
Actual Grid Player View
0 1 1 1 1 H H 1 0 1
1 M 1 2 M 1 H 1 0 H
3 3 2 2 M H H 2 0 H
M M 1 1 1 H H 1 0 1
2 2 1 0 0 H H 1 0 0
Also, if the player should choose a spot that contains a 0(there are no mines in its neighborhood) the program should also reveal all the other adjacent 0's if any.
Please, any help is greatly appreciated
The game board is 5X5 and should have 5 mines randomly placed on the grid. Basically there will be two grids(one that holds the data for mines and how many mines are near each space, and another that is the players view)which should just be a list of lists. The player view grid should start out showing an 'H' in each spot till they are removed by player input.
Example below
Actual Grid Player View
0 1 1 1 1 H H 1 0 1
1 M 1 2 M 1 H 1 0 H
3 3 2 2 M H H 2 0 H
M M 1 1 1 H H 1 0 1
2 2 1 0 0 H H 1 0 0
Also, if the player should choose a spot that contains a 0(there are no mines in its neighborhood) the program should also reveal all the other adjacent 0's if any.
Please, any help is greatly appreciated