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:00
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
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, 02.02.2021 20:50
question
Computers and Technology, 02.02.2021 20:50
question
Social Studies, 02.02.2021 20:50
Questions on the website: 13722367