diff --git a/src/othello/Main.java b/src/othello/Main.java index 49b1afe..06e1046 100644 --- a/src/othello/Main.java +++ b/src/othello/Main.java @@ -7,6 +7,14 @@ public class Main { public static void main(String[] args) { + for (int k=-1; k<2;k++) { + for (int l=-1; l<2; l++) { + if (k!=0 || l!=0) { + System.out.println(k+";"+l); + + } + } + } int p1 = 1, p2 = 2; int[][] board = initialize(p1, p2); State game = new State(board, p1, p2); diff --git a/src/othello/State.java b/src/othello/State.java index 13515d2..35a9fa6 100644 --- a/src/othello/State.java +++ b/src/othello/State.java @@ -33,14 +33,9 @@ public class State { System.out.println("recherche"); for (int k=-1; k<2;k++) { for (int l=-1; l<2; l++) { - // La position du pion trouvé est exclue - if (k!=0 || l!=0) { - // Si une place libre est trouvée elle est ajouté à la liste de coups - System.out.println("close"); - if ( (this.board[i+k][j+l]==0) && (i+k >= 0) && (i+k < 7 ) && (j+l >= 0) && (j+l < 7 ) ) { - System.out.println("jadd"); + if (k!=0 || l!=0) { moves.add(new Point(i+k, j+l)); - } + } } }