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 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
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
Mathematics, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Social Studies, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Mathematics, 15.10.2020 04:01
question
Social Studies, 15.10.2020 04:01
question
English, 15.10.2020 04:01
Questions on the website: 13722367