flut d'octet
This commit is contained in:
23
DEV2.1/CM1/Configuration.java
Normal file
23
DEV2.1/CM1/Configuration.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user