Commit 06f529a6 authored by ssmit235's avatar ssmit235
Browse files

Fixed isBoxComplete method.

parent 25be4ec4
......@@ -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. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment