(Solved):Use Java to write a program that creates a 10×10 multi-dimensional array, places 10 mines in random locations on the board, and finally counts the number of mines an empty space is surrounded by us… View Answer…

 

Question

Use Java to write a program that creates a 10×10 multi-dimensional array, places 10 mines in random locations on the board, and finally counts the number of mines an empty space is surrounded by using its neighboring 8 squares. For reference this works similarly to functionality in the game Minesweeper. Then finally demonstrate that the program can create an empty board, populate it with mines, and finally count mines.

Example dialog:

Creating

Scroll to top