Browse files

Avance en la deteccion de la clasificacion de las manos de poker

  • Loading branch information...
1 parent bea55c7 commit 82c07ab40ebfd9d287e89e12f570de9793df593a @elxris committed Jun 17, 2012
Showing with 49 additions and 0 deletions.
  1. BIN bin/cap7/Ex7_30_Mano.class
  2. +49 −0 src/cap7/Ex7_30_Mano.java
View
BIN bin/cap7/Ex7_30_Mano.class
Binary file not shown.
View
49 src/cap7/Ex7_30_Mano.java
@@ -0,0 +1,49 @@
+package cap7;
+
+public class Ex7_30_Mano {
+ private Ex7_30_Carta mano[];
+ public Ex7_30_Mano( Ex7_30_Carta mano[] ){
+ this.mano = mano.clone();
+ }
+
+ //carta alta
+ public int cartaAlta( String caras[] ){
+ int i = 1;
+ int e;
+ for(e = mano[0].obtenerCara( caras ); i < mano.length; i++){
+ e = Math.max(e, mano[i].obtenerCara(caras));
+ }
+ return e;
+ }
+
+ //un par (valores)
+ public int[] unPar( String caras[] ){
+ int res[] = new int[3];
+ int i;
+ for(i = 0; i < mano.length; i++){
+
+ int e;
+ for(e = 0; e < mano.length; e++){
+ if(mano[i].obtenerCara(caras) == mano[e].obtenerCara(caras)){
+ res[0] = 1;
+ res[1] = i;
+ res[2] = e;
+ return res;
+ }
+ }
+ }
+ return res;
+ }
+
+ //doble par (valores)
+
+ //trio (valores)
+
+ //escalera (5 valores consecutivos sin importar el palo)
+
+ //color (mismo palo)
+
+ //full house (trio de valor y par de valor)
+
+ //poker (cuatro mismo valor)
+}

0 comments on commit 82c07ab

Please sign in to comment.