DEV/ControleMachineJava/Exercice3/PiecePipee.java

25 lines
426 B
Java
Raw Permalink Normal View History

2023-04-27 11:27:11 +02:00
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;
}
}