/*
 * Code used in the "Software Engineering" course.
 *
 * Copyright 2017 by Claudio Cusano (claudio.cusano@unipv.it)
 * Dept of Electrical, Computer and Biomedical Engineering,
 * University of Pavia.
 */
package goldrush;

import java.util.Random;

/**
 *
 * @author cl426792
 */
public class FumagalliGiulia extends GoldDigger {
    int place, days, diggers[];
    
    FumagalliGiulia(){
        days = 0;
    }
    
    @Override
    public void dailyOutcome(int revenue, int[] distances, int[] diggers) { 
        this.diggers = diggers;
        System.out.println(place + " - " + diggers[place]);
    }
    
    @Override
    public int chooseDiggingSite(int[] distances){
        if(days > 0){
            for(int i = distances.length - 1; i >= 0 ; i --){
                if(diggers[i]<5){
                    place = i;
                }
            }
        } else {
            place = new RandomDigger().chooseDiggingSite(distances);
        }
        
        days++;
        return place;
    }
}

@@ -365,32 +365,123 @@
 %0A   
- %0A    FumagalliGiulia()%7B
+// int diggers;%0A  //  Random randomGenerator;%0A    %0A    FumagalliGiulia()%7B%0A    //    randomGenerator = new Random();
 %0A   
@@ -633,68 +633,8 @@
 rs;%0A
-        System.out.println(place + %22 - %22 + diggers%5Bplace%5D);%0A
     
@@ -718,20 +718,273 @@
    i
-f(days %3E 0)%7B
+nt tot = 0, c;%0A        if(days %3E 0)%7B%0A    //        if(diggers %3E 1)%7B%0A    //            place = randomGenerator.nextInt(3);%0A    //        %7D%0A            for(int i = 0; i %3C distances.length; i ++)%7B%0A                tot += diggers%5Bi%5D;%0A            %7D%0A            c = tot/4;
 %0A   

versione 2