Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java-e005-poker-02
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pedro Rolon
java-e005-poker-02
Commits
0ce6efa7
Commit
0ce6efa7
authored
Nov 12, 2018
by
Pedro Rolon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se arregló un error en las calificaciones
parent
6f6721e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
MyClass.java
+20
-18
No files found.
MyClass.java
View file @
0ce6efa7
...
...
@@ -16,8 +16,6 @@ public class MyClass {
ArrayList
<
Carta
[]>
ganadores
=
new
ArrayList
<
Carta
[]>();
//Indica que es la primera mano
boolean
esPrimero
=
true
;
//Para contrar si hubo un nuevo valor mayor
boolean
huboNuevo
=
false
;
//Array para almacenar los índices
ArrayList
<
Integer
>
indices
=
new
ArrayList
<
Integer
>();
//Contador que mantiene el valor del indice
...
...
@@ -47,16 +45,17 @@ public class MyClass {
indices
.
clear
();
indices
.
add
(
index
);
ganadores
.
add
(
mano
);
huboNuevo
=
true
;
break
;
}
else
if
(
calificacionMayor
.
get
(
i
)>
calificacionActual
.
get
(
i
)){
break
;
}
if
(!
huboNuevo
){
//
Si no hubo nuevo, quiere decir que es igual al ganador, por lo tanto, se debe agregar
//a la lista de ganadores sin eliminar ningún otro elemento.
//Si la i llega al tamaño máximo del array, quiere decir
//
que son todos iguales
else
if
(
i
==
calificacionMayor
.
size
()-
1
){
ganadores
.
add
(
mano
);
indices
.
add
(
index
);
huboNuevo
=
false
;
}
}
}
}
...
...
@@ -121,6 +120,7 @@ public class MyClass {
int
aux
=
0
;
calificacion
.
add
(
6
);
//Si hay un AS, se coloca directamente después de la
//calificación
if
(
indiceDe
(
1
,
valores
)!=-
1
){
...
...
@@ -183,6 +183,7 @@ public class MyClass {
calificacion
.
add
(
14
);
//si ya se encontró el 1, entonces este ya no se
//debe agregar al array de calificacion
aux
=
1
;
}
int
[]
ordenado
=
ordenarMano
(
mano
);
...
...
@@ -492,25 +493,25 @@ public class MyClass {
List
<
Carta
[]>
jugadas
=
new
ArrayList
<
Carta
[]>();
Carta
[]
m1
=
new
Carta
[
5
];
m1
[
0
]
=
new
Carta
(
"A
H
"
);
m1
[
1
]
=
new
Carta
(
"
A
D"
);
m1
[
2
]
=
new
Carta
(
"TH
"
);
m1
[
3
]
=
new
Carta
(
"
TC
"
);
m1
[
4
]
=
new
Carta
(
"
6S
"
);
m1
[
0
]
=
new
Carta
(
"A
D
"
);
m1
[
1
]
=
new
Carta
(
"
K
D"
);
m1
[
2
]
=
new
Carta
(
"JD
"
);
m1
[
3
]
=
new
Carta
(
"
9D
"
);
m1
[
4
]
=
new
Carta
(
"
7D
"
);
Carta
[]
m2
=
new
Carta
[
5
];
m2
[
0
]
=
new
Carta
(
"A
H
"
);
m2
[
0
]
=
new
Carta
(
"A
D
"
);
m2
[
1
]
=
new
Carta
(
"KD"
);
m2
[
2
]
=
new
Carta
(
"
QH
"
);
m2
[
3
]
=
new
Carta
(
"
3C
"
);
m2
[
4
]
=
new
Carta
(
"
3S
"
);
m2
[
2
]
=
new
Carta
(
"
JD
"
);
m2
[
3
]
=
new
Carta
(
"
9D
"
);
m2
[
4
]
=
new
Carta
(
"
7D
"
);
jugadas
.
add
(
m1
);
jugadas
.
add
(
m2
);
jugadas
.
add
(
m1
);
String
ganadores
=
mc
.
ganadores
(
jugadas
);
System
.
out
.
println
(
"Sum of x+y = "
+
z
);
//
System.out.println("Sum of x+y = " + z);
System
.
out
.
println
(
"Ganadores = "
+
ganadores
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment