/*
 * 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;

/**
 *  @author Reina Michele cl418656
 * @author Bonissone Davidecl427113
 */
public class BoniMichele extends GoldDigger{ //
int t=0;
   int j=99;
    @Override
    public int chooseDiggingSite(int[] distances) {
     
        for (int i=0; i<distances.length; i++){
          if (t==0){
            
            if (distances[i]==30) {
               j=i;
               t++;
            }
        }else
           {
            
            if (distances[i]== 200) {
               j=i;
               
              
            }
         }
          
        }
       
    return j;
          
        }
    
}

@@ -552,17 +552,18 @@
 ces%5Bi%5D==
-3
+14
 0) %7B%0A   
@@ -626,41 +626,33 @@
    %7D
-else
 %0A     
-      %7B%0A            %0A  
+else   if (t%3C3) %7B %0A
     
@@ -676,18 +676,17 @@
 es%5Bi%5D== 
-20
+3
 0) %7B%0A   
@@ -709,32 +709,36 @@
 %0A               
+t=0;
 %0A              %0A
@@ -763,29 +763,121 @@
      %7D%0A     
-     
+else %7B%0A        if (distances%5Bi%5D== 200) %7B%0A               j=i;%0A               t=0;%0A     %7D%0A        %7D
 %0A        %7D%0A 

test finale