subject

Minesweeper is a single-player game in which the player continuously selects different cells of an grid. each cell of the grid is either occupied by a bomb or is a safe cell. if a cell is occupied 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 bombs neighboring that cell. sample input 1: 2 220 01 1sample output 1: * 22 *sample input 2: 5 341 22 24 04 1sample output 2: 0 1 10 2 *0 2 *2 3 2* * 1sample input 3: 4 770 01 12 23 32 41 50 6sample output 3: * 2 1 0 1 2 *2 * 2 2 2 * 21 2 * 3 * 2 10 1 2 * 2 1 0sample input 4: 2 650 11 01 11 21 5sample output 4: 3 * 3 1 1 1* * * 1 1 *sample input 5: 3 390 00 10 21 01 11 22 02 12 2sample output 5: * * ** * ** * *

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 23.06.2019 09:10
(328 inc. 448 ind. 480 in25. john has a collection of toy cars. he has 2 red cars, 4 blue cars, 4 black cars, and 6 yellowcars. what is the ratio of red cars to yellow cars? a. 1: 2b. 1: 3c. 1: 626. the net of a right triangular prism is shown below.
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
You know the right answer?
Minesweeper is a single-player game in which the player continuously selects different cells of an g...
Questions
question
Arts, 07.02.2021 06:50
question
History, 07.02.2021 06:50