Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started