c语言扫雷游戏 minesweeper实现

minesweeper C 程序代写

1. (Time: 2 – 3 hours) For your final project you will be implementing the computer

game minesweeper. The game of minesweeper works as follows:

1. There is a rectangular grid of tiles

2. Hidden under some of the tiles are mines

3. Your goal is to mark all the tiles that contain mines and uncover all the tiles

4. If you uncover a tile that contains a mine you lose the game

5. If you uncover a tile that doesn’t contain a mine, it tells you how many mines

that don’t contain mines

are hidden in the eight surrounding squares

Here are some example boards with all of their contents revealed so that you can get an

idea as to what they look like.

Example 1:

2 * * 2 0

1 5 * 3 0

0 * * 2 0

0 1 2 3

Example 2:

9 0 0 0 0 0 1 1 1 0 0

8 0 0 0 0 0 1 * 1 0 0

7 0 1 1 1 0 1 1 2 1 1

6 0 1 * 1 1 1 1 1 * 1

5 0 1 1 1 1 * 1 1 1 1

4 1 1 1 0 1 1 1 0 0 0

3 1 * 1 0 0 0 0 0 0 0

2 1 1 1 0 0 0 0 0 0 0

1 1 2 1 1 0 1 1 2 2 2

0 * 2 * 1 0 1 * 2 * *

0 1 2 3 4 5 6 7 8 9

Requirements

1. Name your exe

Leave a Reply

Your email address will not be published. Required fields are marked *