Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA PLEASE Minesweeper is a single-player game in which the player continuously selects different cells of an m n grid. Each cell of the

IN JAVA PLEASE

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 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 (in java) that receives 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 b lines of input from the user, each referring to the row and column index of each one of the bombs.

After receiving grid dimensions, 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 neighboring bombs to that cell.

ex input:

22

2

00

11

ex output:

* 2

2 *

PLEASE ADD COMMENTS WITH // IN EACH SECTION EXPLAINING THE CODE (im trying to learn how to write this program/ get an idea of where to start my code, not copy it)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Discuss the strengths of a businessembedded learning function.

Answered: 1 week ago

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago