-
Notifications
You must be signed in to change notification settings - Fork 13
Create the ultimate minesweeper #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Create the ultimate minesweeper #3
Conversation
DavidWhitlock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you got off to a good start!
👍
| if (row == 0 || column == 0) { | ||
| throw new ZeroSizedBoardException(); | ||
| } | ||
| this.inputBoard = new char[row][column]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting choice of data structure. I wonder if an ArrayList would be easier to work with.
| } | ||
|
|
||
| public String solve() { | ||
| // for (int i = 0; i < inputBoard.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh. It's hard to resist implementing, isn't it? 😈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @Ignore | ||
| @Test(expected = ZeroSizedBoardException.class) | ||
| public void zeroSizedBoardThrowException() { | ||
| public void zeroSizedBoardThrowException() throws ZeroSizedBoardException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend using making ZeroSizedBoardException a RuntimeException so that you don't to declare it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!


Added "AddRow" method.
Fixed improper 2 space indenting to a more dignified 4 spaces.