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
#2
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

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