Question: Write a recursive method that counts the number of mines on a grid. A mine is defined as a contiguous collection of X's (connected horizontally

Write a recursive method that counts the number of mines on a grid. A mine is defined as a contiguous collection of X's (connected horizontally and vertically).

Recursive method = A method calls its self.

Assignment name: MS count the Mines

Using JAVA Language..

Input

Max dimensions of the array

Distribution of mines on the array

Output

The number of mines and the layout of the grid showing the locations of the mines.

Requirements checklist:

Documented source code (include any assumptions you make)

Write a recursive method that counts the number of mines on a

Input File (in.txt) The format of the input file is as follows: First line is the dimensions of the grid.. Then the grid containing 1s for the creatures and Os for the spaces. The file terminates by 0 0 xXX xXX X. Output File (out.txt) Experiment # 1 Number of Mines: 1 01110 Experiment #2 Number of Mines: 3 00001 0222 0 30000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!