Skip to content
Snippets Groups Projects
Commit 06f529a6 authored by ssmit235's avatar ssmit235
Browse files

Fixed isBoxComplete method.

parent 25be4ec4
No related branches found
No related tags found
No related merge requests found
......@@ -112,8 +112,8 @@ public class DotsAndBoxesGrid {
}
// A box is complete if the north and south horizontals and the east and west verticals have all been drawn.
// FIXME: You'll need to fix this code (after writing a test first).
return true;
boolean isBoxComplete = getHorizontal(x, y) && getVertical(x, y) && getVertical(x+1, y) && getHorizontal(x, y+1);
return isBoxComplete;
}
/** Tries to claim a box for a player. If the box is complete, sets the ownership and returns true. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment