diff --git a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java index 922fae93debe6adc3698afe208245f21df672363..feaac4bc9a1490dfcebf3dcecb23d32242986f71 100644 --- a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java +++ b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java @@ -117,7 +117,10 @@ 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; + if ((getHorizontal(x, y) && getHorizontal(x, y + 1)) && (getVertical(x, y) && getVertical(x + 1, y))) { + return true; + } + return false; } /** Tries to claim a box for a player. If the box is complete, sets the ownership and returns true. */