Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Program: make a game of Minesweeper 2D array (6 x 6) with 10 mines randomly placed. Create a Main class that represents

Write a Java Program: make a game of Minesweeper 2D array (6 x 6) with 10 mines randomly placed.

Create a Main class that represents the instance of the Game class and calls the run() method. Create a Game class that contains the 2D array (6x6) minesweeper grid and a public run() method using text (character) based. Create a Board class using String or char to represent that character in the grid. The grid will consist of digits, M for mine, and - (hyphen). The user will be prompt to identify where the mines are: enter a row: and enter a column: (If there's a mine user gets a "You lose" if not user is prompted for another row and column). The user wins if no mines go off gets a "You win."

Sample Output:

- - - - - -

- - - - - -

- - - - - -

- - - - - -

- - - - - -

- - - - - -

Enter a row: 1

Enter a column: 1

M - - - - -

- - - - - -

- - - - - -

- - - - - -

- - - - - -

- - - - - -

You lose

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions