25 lines
426 B
Java
25 lines
426 B
Java
import java.awt.*;
|
|
import javax.swing.*;
|
|
import java.util.*;
|
|
|
|
public class PiecePipee implements ObjetAleatoire {
|
|
|
|
private int faceVisible; // 0 = pile; 1 = face.
|
|
|
|
public PiecePipee(){
|
|
this.faceVisible=faceVisible;
|
|
}
|
|
|
|
public void lancer(){
|
|
Random r = new Random();
|
|
if(r.nextInt()%10<7&&r.nextInt()%10>-7){
|
|
this.faceVisible=0;
|
|
}else{
|
|
this.faceVisible=1;
|
|
}
|
|
}
|
|
|
|
public int lire(){
|
|
return faceVisible;
|
|
}
|
|
} |