How We Hire Writers

custom writing

All applicants go through a series of tests that check their level of English and knowledge of formatting styles. The applicant is also required to present a sample of writing to the Evaluation Department. If you wish to find out more about the procedure, check out the whole process.

How We Ensure Quality

Our Quality Control Department checks every single order for formatting, style, word usage, and authenticity. This lets us deliver certified assignment assistance that has no Internet rivals.

minesweeper

Minesweeper is a single-player game in which the player continuously selects different cells of an m n grid. Each cell of the grid is either occupied by a bomb or is a safe cell. If a cell is occupied by a bomb and the player selects the cell, the player loses. Otherwise, the selected cell shows the number of bombs in the neighboring cells. A neighbor cell is a cell next to the current cell in the horizontal, vertical, and diagonal direction.

Write a program that receives in the first input line m and n as the number of rows and columns of the grid, respectively. In the second line, the user inputs an integer, b, showing the number of bombs placed in the grid. It then follows by lines of input from the user, each referring to the row and column index of each one of the bombs.

After receiving grid dimensions, the number of bombs, and bomb locations, you will need to display (print) the completed grid showing the bomb cells with * and safe cells with the number of safe cells neighboring that cell.

Note: In a regular minesweeper game, the integers in the grid denote the number of bombs in the neighboring cells. We have changed it to the number of safe cells for the purpose of this question only.

Examples:

Input:

2 2

2

0 0

1 1

Output:

*1

1*

Input:

3 2

1

0 1

Output:

2 *

4 4

3 3

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes