Jan-02-2019, 12:48 AM
How to program a minesweeper game with this characteristics?
Please help!
IThe 4 × 4 field on the left contains two mines, each represented by an “*” character. If we represent the same field by the hint numbers described above, we end up with the field on the right:
*... *100
.... 2210
.*.. 1*10
.... 1110
It should take the mine field on the left and generates the hint numbers shown on the right.
The input will consist of a 2D list (with an arbitrary number of rows and columns) repre- senting a field. Each list in the 2D list will consist of “.” and “*”. Safe squares are denoted by “.” and mine squares by “*”. For example, this 2D list:
field = [[’∗’, ’.’, ’.’, ’.’],
[’.’, ’.’, ’.’, ’.’],
[’.’, ’∗’, ’.’, ’.’],
[’.’, ’.’, ’.’, ’.’]]
The hints for the field above would be a 2D list:
hint = [[∗100] , [2210] , [1∗10] , [1110]]
Please help!
IThe 4 × 4 field on the left contains two mines, each represented by an “*” character. If we represent the same field by the hint numbers described above, we end up with the field on the right:
*... *100
.... 2210
.*.. 1*10
.... 1110
It should take the mine field on the left and generates the hint numbers shown on the right.
The input will consist of a 2D list (with an arbitrary number of rows and columns) repre- senting a field. Each list in the 2D list will consist of “.” and “*”. Safe squares are denoted by “.” and mine squares by “*”. For example, this 2D list:
field = [[’∗’, ’.’, ’.’, ’.’],
[’.’, ’.’, ’.’, ’.’],
[’.’, ’∗’, ’.’, ’.’],
[’.’, ’.’, ’.’, ’.’]]
The hints for the field above would be a 2D list:
hint = [[∗100] , [2210] , [1∗10] , [1110]]