Question
Java Programming Language How can I make @Test units for this code: public class MineField { int rows; int columns; int maximumMines; boolean[][] minefield =
Java Programming Language
How can I make @Test units for this code:
public class MineField { int rows; int columns; int maximumMines; boolean[][] minefield = new boolean [10][10]; int [][] minedNeighbours = new int[10][10]; int alreadyMined = 0; MineField(int row, int col, int maxMine){ rows = row; columns = col; maximumMines = maxMine; for (int i=0; i<10; i++){ for (int j=0; j<10; j++){ minefield[i][j] = false; minedNeighbours[i][j] = 0; } } } public boolean mineTile(int row, int col){ if (alreadyMined < maximumMines){ if (!minefield[row][col]){ minefield[row][col] = true; alreadyMined++; for (int i=0; i
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