From 5d08119c43b368cbc80df47611b80189822c3494 Mon Sep 17 00:00:00 2001 From: Martin Schreiber <mschreib@myune.edu.au> Date: Thu, 22 Jul 2021 17:58:51 +0930 Subject: [PATCH] fixed issue where drawVerticle() was checking wrong boxes --- src/main/java/dotsandboxes/DotsAndBoxesGrid.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java index a0e915e..a51be3d 100644 --- a/src/main/java/dotsandboxes/DotsAndBoxesGrid.java +++ b/src/main/java/dotsandboxes/DotsAndBoxesGrid.java @@ -184,9 +184,9 @@ public class DotsAndBoxesGrid { }else{ this.verticals[x][y] = true; - // Try to claim the north or south boxes - boolean claimN = claimBox(x, y-1, player); - boolean claimS = claimBox(x, y, player); + // Try to claim the left or right boxes + boolean claimN = claimBox(x, y, player); + boolean claimS = claimBox(x-1, y, player); if (claimN || claimS) { notifyObservers(); return true; -- GitLab