Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void pondre() {
- Random rnd = new Random();
- for (int i = 0; i < 10; i++) {
- double prob = rnd.nextDouble();
- if (prob <= 0.1) {
- FourmiLarveReine reine = new FourmiLarveReine(
- FourmiIdent.ident());
- Fourmiliere.creer.add(reine);
- } else if (prob <= 0.2) {
- double prob2 = rnd.nextDouble();
- if (prob2 <= 0.5) {
- FourmiLarveReine reine = new FourmiLarveReine(
- FourmiIdent.ident());
- Fourmiliere.creer.add(reine);
- } else {
- FourmiLarveMale male = new FourmiLarveMale(
- FourmiIdent.ident());
- Fourmiliere.creer.add(male);
- }
- } else {
- FourmiLarveOuvriere ouvriere = new FourmiLarveOuvriere(
- FourmiIdent.ident());
- Fourmiliere.creer.add(ouvriere);
- }
- }
- }
Add Comment
Please, Sign In to add comment