diff --git a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java index 32325bc874a8002949994740e3b6b2ea275392db..12d053222aaa91dfb1004b24d454fca4d6d36309 100644 --- a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java +++ b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java @@ -118,12 +118,12 @@ public class DotsAndBoxesGrid { return false; } - // if (getHorizontal(x, y) && - // getHorizontal(x, y + 1) && - // getVertical(x, y) && - // getVertical(x + 1, y)) { - // return true; - // } + if (getHorizontal(x, y) && + getHorizontal(x, y + 1) && + getVertical(x, y) && + getVertical(x + 1, y)) { + return true; + } return false; } @@ -160,9 +160,9 @@ public class DotsAndBoxesGrid { } // FIXME: You need to throw an exception if the line was already drawn. - // if (getHorizontal(x, y) == true) { - // throw new RuntimeException(); - // } + if (getHorizontal(x, y) == true) { + throw new RuntimeException(); + } this.horizontals[x][y] = true; @@ -200,9 +200,9 @@ public class DotsAndBoxesGrid { throw new RuntimeException(); } // You need to throw an exception if the line was already drawn. - // if (getVertical(x, y) == true) { - // throw new RuntimeException(); - // } + if (getVertical(x, y) == true) { + throw new RuntimeException(); + } this.verticals[x][y] = true; // Try to claim the north or south boxes