Commit fe215e30 by Jose Baez

Se corrije metodo TRIO

parent dfe88611
......@@ -76,33 +76,19 @@ public class Juego {
valores.add(extraer(c.valor));
}
Collections.sort(valores);
int counter=0;
int numero=0;
int cantidadNumero=0;
int cantidadNumero2=0;
for(int i=1; i<14; i++){
for (int j=0; j<valores.size(); j++) {
int s= valores.get(j);
if(s == i){
counter++;
int[] numerosArray = pasarAArray(valores);
int con=0;
for (int i = 0; i < numerosArray.length-1; i++) {
if (numerosArray[i] == numerosArray[i+1]) {
con++;
if (con==3 && numerosArray[2] == numerosArray[4]){
return true;
}else if(con==3 && numerosArray[2] == numerosArray[0]){
return true;
}
}
if(counter > cantidadNumero){
numero=i;
cantidadNumero=counter;
cantidadNumero2=counter;
}
if((counter-1) > cantidadNumero){
cantidadNumero2=counter;
}
counter=0;
}
if (cantidadNumero==3 && (cantidadNumero2-1)==2){
return true;
}else {
return false;
}
return false;
}
//Cuatro cartas iguales (mismo valor).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment