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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, edjiejwi
Lisa has a section of her document that she would like to include in the index. which option should lisa choose? mark index mark entry insert endnote add text
Answers: 3
image
Computers and Technology, 23.06.2019 17:00, solizpaco7124
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, kenyasutton10
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, Artemis3821
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
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 in other subjects:

Konu
World Languages, 15.03.2022 02:00
Konu
English, 15.03.2022 02:00
Konu
Chemistry, 15.03.2022 02:00
Konu
English, 15.03.2022 02:00
Konu
Mathematics, 15.03.2022 02:00