DEV/ControleMachineJava/Exercice3/Piece.java
2023-04-27 11:27:11 +02:00

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;
}
}