Skip to content
Snippets Groups Projects
Commit 72dffe9d authored by SAIDI Hatim's avatar SAIDI Hatim
Browse files

test

parent 59e45a72
Branches
No related tags found
No related merge requests found
......@@ -10,16 +10,16 @@ public class ArrayGrid implements Grid{
public ArrayGrid(int numberOfRows,int numberOfColumns) {
this.numberOfRows = numberOfRows;
this.numberOfColumns = numberOfColumns;
if (numberOfColumns > 0 || numberOfRows > 0) {
if (numberOfColumns <= 0 || numberOfRows <= 0) {
throw new IllegalArgumentException();
}
else {
for (int j = 0; j < this.numberOfColumns; j++) {
for (int i = 0; i < this.numberOfRows; i++) {
cells[numberOfRows][numberOfColumns] = new SquareCell();
}
}
}
else {
throw new IllegalArgumentException() ;
}
}
public Cell getCell(int row, int column) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment