From 9251c50cb02fa520741a6fa1b35c08eb76dd7519 Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Tue, 7 Feb 2023 00:01:39 +0100 Subject: [PATCH] Update Implementation Methode AIGridGUI --- src/main/java/BattleShip/AIGridGUI.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } }