From 6373a92bf7e91c5f4979f457e4b435b2480a990c Mon Sep 17 00:00:00 2001 From: Niveditha Venugopal Date: Wed, 26 Jul 2017 20:20:53 -0700 Subject: [PATCH] Changes made by Liz and Niveditha --- .../edu/pdx/cs410J/katas/Minesweeper.java | 33 ++++++++++++++++--- .../edu/pdx/cs410J/katas/MinesweeperTest.java | 28 ++++++++-------- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/minesweeper/src/main/java/edu/pdx/cs410J/katas/Minesweeper.java b/minesweeper/src/main/java/edu/pdx/cs410J/katas/Minesweeper.java index 3fe6bf0..cc3c42b 100644 --- a/minesweeper/src/main/java/edu/pdx/cs410J/katas/Minesweeper.java +++ b/minesweeper/src/main/java/edu/pdx/cs410J/katas/Minesweeper.java @@ -1,16 +1,41 @@ package edu.pdx.cs410J.katas; -public class Minesweeper { +import java.util.ArrayList; +import java.util.List; - public Minesweeper(int row, int column) { +public class Minesweeper { + private int row, column; + private List board = new ArrayList<>(); + public Minesweeper(int row, int column) throws ZeroSizedBoardException{ + if(row == 0 || column == 0){ + throw new ZeroSizedBoardException(); + } + this.row = row; + this.column = column; } - public void addRow(String row) { + public void addRow(String row) throws RaggedBoardException{ + + if(row.length() != this.column){ + throw new RaggedBoardException(); + } + for(int i = 0; i