21 lines
350 B
Java
21 lines
350 B
Java
|
import java.awt.*;
|
||
|
import javax.swing.*;
|
||
|
import java.util.*;
|
||
|
|
||
|
public class Piece implements ObjetAleatoire {
|
||
|
|
||
|
private int faceVisible; // 0 = pile; 1 = face.
|
||
|
|
||
|
public Piece(){
|
||
|
this.faceVisible=faceVisible;
|
||
|
}
|
||
|
|
||
|
public void lancer(){
|
||
|
Random r = new Random();
|
||
|
this.faceVisible=(r.nextInt()%2);
|
||
|
}
|
||
|
|
||
|
public int lire(){
|
||
|
return faceVisible;
|
||
|
}
|
||
|
}
|