Python Forum
Minesweeper Game - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Minesweeper Game (/thread-15061.html)



Minesweeper Game - TrustBusiness - Jan-02-2019

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]]


RE: Minesweeper Game - ichabod801 - Jan-02-2019

We're not going to write your code for you. We would be glad to help you fix your code when you run into problems. When you do run into problems, be sure to post your code in Python tags, and clearly explain the problem you are having, including the full text of any errors.