1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| public class Roulette {
/**Attributs*/
protected int mise_min;
protected int mise_max;
protected int[]pair=new int[]{2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36};
protected int[]passe=new int[]{19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36};
protected int[]rouge=new int[]{32,19,21,25,34,27,36,30,23,5,16,1,14,9,18,7,12,3};
protected int nombre;
protected boolean est_pair;
/**Constructeur*/
public Roulette(int mise_min,int mise_max){
this.mise_min=mise_min;
this.mise_max=mise_max;
}
/**Méthodes*/
public int tirage(){
int nombre=(int)(Math.random()*36);
/**permet d'obtenir un nombre pseudo-aléatoire compris entre 0(par défaut) et 36*/
return nombre;
}
public int getNombre(){
return this.nombre;
}
public boolean estPair(){
this.est_pair=false;
for (int i=0;i<this.pair.length;i++){
if (this.nombre==pair[i]){
this.est_pair=true;
break;
}
}
return this.est_pair;
}
} |