flut d'octet

This commit is contained in:
2024-03-25 14:56:28 +01:00
parent 0bf4ebd6b6
commit f411998b31
30 changed files with 335 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
public class Configuration{
private int[][] morpion;
public Configuration(){
this.morpion = new int[][] {{0,0,0},{0,0,0},{0,0,0}};
}
public boolean EstLibre(int position){
int ligne = position/3;
int colonne = position%3;
if (this.morpion[ligne][colonne] == 0){
return true;
}
return false;
}
// joueur peut être soit 1(= la croix) ou 2(= le rond) pour l'ordre de jeux//
public void Jouer(int position, int joueur){
int ligne = position/3;
int colonne = position%3;
this.morpion[ligne][colonne] = joueur;
}
}