diff --git a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java index 4c22cf81b3d025e2b046def8e3f9ec360b56eee2..8f323c3798d3e68e3a022fdf19c2c5d3dd6b7a62 100644 --- a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java +++ b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java @@ -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. */