Guest User

Untitled

a guest
Jan 4th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1.    public void pondre() {
  2.     Random rnd = new Random();
  3.     for (int i = 0; i < 10; i++) {
  4.         double prob = rnd.nextDouble();
  5.         if (prob <= 0.1) {
  6.         FourmiLarveReine reine = new FourmiLarveReine(
  7.             FourmiIdent.ident());
  8.         Fourmiliere.creer.add(reine);
  9.         } else if (prob <= 0.2) {
  10.         double prob2 = rnd.nextDouble();
  11.         if (prob2 <= 0.5) {
  12.             FourmiLarveReine reine = new FourmiLarveReine(
  13.                 FourmiIdent.ident());
  14.             Fourmiliere.creer.add(reine);
  15.         } else {
  16.             FourmiLarveMale male = new FourmiLarveMale(
  17.                 FourmiIdent.ident());
  18.             Fourmiliere.creer.add(male);
  19.         }
  20.         } else {
  21.         FourmiLarveOuvriere ouvriere = new FourmiLarveOuvriere(
  22.             FourmiIdent.ident());
  23.         Fourmiliere.creer.add(ouvriere);
  24.         }
  25.     }
  26.     }
Add Comment
Please, Sign In to add comment