Commit 89deb808 by Emanuel Lugo

poker2

parent c6fc3fec
......@@ -25,7 +25,7 @@ public class Carta {
this.palo = String.valueOf(completo.charAt(1));
}
String valorPalo() {
public String valorPalo() {
if (this.valor.equals("1")) {
return "A" + this.palo;
} else if (this.valor.equals("10")) {
......
package poker2;
import poker.*;
import java.util.ArrayList;
import java.util.*;
public class PokerGame2 {
public String ganadores(List<Carta[]> jugadas)
{
System.out.println("Cantidad de jugadas: " + jugadas.size());
for (Carta[] mano : jugadas) {
System.out.println("JUGADA ======================");
for (Carta c : mano) {
System.out.println(c.valorPalo());
}
}
return "0";
}
public static void main(String args[]) {
PokerGame2 mc = new PokerGame2();
List<Carta[]> jugadas = new ArrayList<Carta[]>();
Carta[] m1 = new Carta[5];
m1[0] = new Carta("AH");
m1[1] = new Carta("AD");
m1[2] = new Carta("TH");
m1[3] = new Carta("TC");
m1[4] = new Carta("6S");
Carta[] m2 = new Carta[5];
m2[0] = new Carta("AH");
m2[1] = new Carta("KD");
m2[2] = new Carta("QH");
m2[3] = new Carta("3C");
m2[4] = new Carta("3S");
jugadas.add(m1);
jugadas.add(m2);
String ganadores = mc.ganadores(jugadas);
System.out.println("Ganadores = " + ganadores);
}
public int valorJugada(String jugada) {
String result;
switch (animal) {
case "DOG":
result = "domestic animal";
break;
case "CAT":
result = "domestic animal";
break;
case "TIGER":
result = "wild animal";
break;
default:
result = "unknown animal";
break;
}
return result;
}
}
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