Browse Source

Update Implementation AIGridGUI class

main
Thoumi Ngonga Brice 2 years ago
parent
commit
7001d7fb1d
  1. 9
      src/main/java/BattleShip/AIGridGUI.java

9
src/main/java/BattleShip/AIGridGUI.java

@ -270,6 +270,15 @@ public class AIGridGUI extends JPanel {
} }
right.setCell(r); right.setCell(r);
right.setCount(rightCount); right.setCount(rightCount);
int l = f;
int leftCount = -1;
while(l >= 0 && cellsHit[l] && !cellsKilled[l]) {
l = moveLeft(l);
leftCount++;
}
left.setCell(l);
left.setCount(leftCount);
} }
} }

Loading…
Cancel
Save