From 233f8cbb9a3865d155ec8126a50fbb2349ed1dea Mon Sep 17 00:00:00 2001 From: Emanuel Lugo Date: Tue, 26 Apr 2022 17:36:38 -0400 Subject: [PATCH] Correccion de errores --- pokerGame.java | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/pokerGame.java b/pokerGame.java index 1576f4b..d84e604 100644 --- a/pokerGame.java +++ b/pokerGame.java @@ -54,28 +54,21 @@ public class pokerGame { valoresIguales++; } } + if (valoresIguales == 3 && mano.get(3).getValorInt() != mano.get(4).getValorInt()) { return resultado = "POKER"; - }else if ((valoresIguales == 2 && mano.get(3).getValorInt() == mano.get(4).getValorInt()) || (valoresIguales == 2 && mano.get(0).getValorInt() == mano.get(1).getValorInt())) + }else if ((valoresIguales == 3 && mano.get(3).getValorInt() == mano.get(4).getValorInt()) || (valoresIguales == 3 && mano.get(0).getValorInt() == mano.get(1).getValorInt())) { return resultado = "FULL";} - else if (valoresIguales == 2){ + else if ((valoresIguales == 2 && mano.get(3).getValorInt() != mano.get(4).getValorInt()) || (valoresIguales == 2 && mano.get(0).getValorInt() != mano.get(1).getValorInt())){ return resultado = "TRIO"; } - - - - - - - - - - - + if ((valoresIguales == 2 && mano.get(1).getValorInt() != mano.get(2).getValorInt()) || (valoresIguales == 2 && mano.get(2).getValorInt() != mano.get(4).getValorInt())) { + return resultado = "DOBLE DUO"; + } else if (valoresIguales ==1 ) return resultado = "DUO" ; return resultado = "CARTA ALTA"; } @@ -86,10 +79,10 @@ public class pokerGame { int i; Carta carta1, carta2, carta3, carta4, carta5 ; ArrayList mano = new ArrayList(); - carta1 = new Carta("AS"); - carta2 = new Carta("TS"); - carta3 = new Carta("JS"); - carta4 = new Carta("QS"); + carta1 = new Carta("8S"); + carta2 = new Carta("8C"); + carta3 = new Carta("7S"); + carta4 = new Carta("7C"); carta5 = new Carta("KS"); mano.add(carta5) ; mano.add(carta4) ; -- libgit2 0.26.0