/*
 * 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[];
   // int diggers;
  //  Random randomGenerator;
    
    FumagalliGiulia(){
    //    randomGenerator = new Random();
        days = 0;
    }
    
    @Override
    public void dailyOutcome(int revenue, int[] distances, int[] diggers) { 
        this.diggers = diggers;
    }
    
    @Override
    public int chooseDiggingSite(int[] distances){
        if(days > 0){
    //        if(diggers > 1){
    //            place = randomGenerator.nextInt(3);
    //        }
            for(int i = distances.length - 1; i >= 0 ; i --){
                if(diggers[i]<2){
                    place = i;
                }
            }
        } else {
            place = 0;
        }
        
        days++;
        return place;
    }
}

@@ -365,123 +365,32 @@
 %0A   
-// int diggers;%0A  //  Random randomGenerator;%0A    %0A    FumagalliGiulia()%7B%0A    //    randomGenerator = new Random();
+ %0A    FumagalliGiulia()%7B
 %0A   
@@ -538,16 +538,76 @@
 iggers;%0A
+        System.out.println(place + %22 - %22 + diggers%5Bplace%5D);%0A
     %7D%0A  
@@ -700,109 +700,8 @@
 0)%7B%0A
-    //        if(diggers %3E 1)%7B%0A    //            place = randomGenerator.nextInt(3);%0A    //        %7D%0A
     
@@ -788,17 +788,17 @@
 gers%5Bi%5D%3C
-2
+5
 )%7B%0A     
@@ -892,17 +892,63 @@
 place = 
-0
+new RandomDigger().chooseDiggingSite(distances)
 ;%0A      

versione 2