Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minesweeper Game
#1
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]]
Reply


Messages In This Thread
Minesweeper Game - by TrustBusiness - Jan-02-2019, 12:48 AM
RE: Minesweeper Game - by ichabod801 - Jan-02-2019, 01:42 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020