fix playable cell

This commit is contained in:
Aubin DORIVAL
2025-03-31 17:46:14 +02:00
parent 3161bf7c95
commit 5866807a78

View File

@@ -25,6 +25,12 @@ public class GomokuBoard{
System.out.println(test); System.out.println(test);
System.out.println(test.getPlayableCells()); 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);
test.expandBoard(Cardinal.SW);
System.out.println(test); System.out.println(test);
System.out.println(test.getPlayableCells()); System.out.println(test.getPlayableCells());
} }
@@ -146,7 +152,7 @@ public class GomokuBoard{
List<GomokuCell> output = new ArrayList<>(); List<GomokuCell> output = new ArrayList<>();
for (GomokuCell[] line : this.getAllsCells()) { for (GomokuCell[] line : this.getAllsCells()) {
for (GomokuCell c : line) { for (GomokuCell c : line) {
if (c.isPlayable()) if (c.isPlayable() && c.getState() == Color.NIL)
output.add(c); output.add(c);
} }
} }