diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index f9a75ef..4108b81 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -261,6 +261,15 @@ public class AIGridGUI extends JPanel { } down.setCell(d); down.setCount(downCount); + + int r = f; + int rightCount = -1; + while(r >= 0 && cellsHit[r] && !cellsKilled[r]) { + r = moveRight(r); + rightCount++; + } + right.setCell(r); + right.setCount(rightCount); } }