(Solved):Write a Java 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… View Answer…

 

Question

Write a Java 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 empty board

Scroll to top