25 lines
377 B
Java
25 lines
377 B
Java
|
import java.util.Random;
|
||
|
|
||
|
|
||
|
public class Piece implements ObjetAleatoire
|
||
|
{
|
||
|
Random rnd = new Random(System.currentTimeMillis());
|
||
|
|
||
|
private int pof;
|
||
|
|
||
|
public void lancer()
|
||
|
{
|
||
|
this.pof = rnd.nextInt(2);
|
||
|
}
|
||
|
|
||
|
public int lire()
|
||
|
{
|
||
|
return this.pof;
|
||
|
}
|
||
|
|
||
|
public static void main(String[] args) {
|
||
|
Piece test = new Piece();
|
||
|
test.lancer();
|
||
|
System.out.println(test.lire());
|
||
|
}
|
||
|
}
|