From 5866807a78a81351e294de846a8ea12131f71bb5 Mon Sep 17 00:00:00 2001 From: Aubin DORIVAL Date: Mon, 31 Mar 2025 17:46:14 +0200 Subject: [PATCH] fix playable cell --- src/GomokuBoard.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GomokuBoard.java b/src/GomokuBoard.java index e3d5865..ea07708 100644 --- a/src/GomokuBoard.java +++ b/src/GomokuBoard.java @@ -25,6 +25,12 @@ public class GomokuBoard{ System.out.println(test); System.out.println(test.getPlayableCells()); test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); + test.expandBoard(Cardinal.SW); System.out.println(test); System.out.println(test.getPlayableCells()); } @@ -146,7 +152,7 @@ public class GomokuBoard{ List output = new ArrayList<>(); for (GomokuCell[] line : this.getAllsCells()) { for (GomokuCell c : line) { - if (c.isPlayable()) + if (c.isPlayable() && c.getState() == Color.NIL) output.add(c); } }