début methode clonage
This commit is contained in:
parent
3d87d7234f
commit
9316c144d4
@ -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);
|
||||
|
@ -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");
|
||||
moves.add(new Point(i+k, j+l));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user