From 2ebf65ff1bf8d7cdaebbf02d5543ba840076ad1d Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Mon, 6 Feb 2023 23:56:58 +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 e67f2de..f9a75ef 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -252,6 +252,15 @@ public class AIGridGUI extends JPanel { } up.setCell(u); up.setCount(upCount); + + int d = f; + int downCount = -1; + while(d >= 0 && cellsHit[d] && !cellsKilled[d]) { + d = moveDown(d); + downCount++; + } + down.setCell(d); + down.setCount(downCount); } }