Commit 55d5a02d by Joel Florentin

input en poker

parent 7dcf18ae
......@@ -19,6 +19,48 @@ public class Poker{
jugadasPosibles(0,0,mazo,mano);
System.out.println(nroJugadas);
cadaJugada.entrySet().forEach(k -> System.out.printf("%s : %.5f%%\n",k.getKey(),100*k.getValue()/(float)nroJugadas));
String manoInput = System.console().readLine("Ingrese mano separado por como. Color: S,C,H,D. Numero: del A al K. Ejemplo AS,KH,3C,5D\n");
String [] cartasMano =manoInput.split(",");
Carta [] mano1 = new Carta[MANO_CAPACIDAD];
char color,numero;
Color c1=Color.S;
int v1=1,k=0;
for (String ca : cartasMano) {
numero = ca.charAt(0);
color = ca.charAt(1);
switch (color) {
case 'S':
c1 = Color.S;
break;
case 'C':
c1 = Color.C;
break;
case 'H':
c1 = Color.H;
break;
case 'D':
c1 = Color.D;
break;
}
for (int j = 0; j < Carta.valores.length; j++) {
if(Carta.valores[j].charAt(0)==numero){
v1 = j+1;
break;
}
}
mano1[k] = new Carta(v1,c1);
k++;
}
System.out.println("La jugada es....");
for (Carta carta : mano1) {
System.out.printf("%s ",carta);
}
System.out.println();
System.out.println(comprobarJugada(mano1));
}
public static String comprobarJugada(Carta [] mano) {
......
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