Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
poker
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
Yovan Martinez
poker
Commits
1698eabc
Commit
1698eabc
authored
Apr 26, 2022
by
Yovan Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mejoras interfaz de usuario y control de ingreso de cartas repetidas
parent
089839b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
14 deletions
+29
-14
Poker.java
+29
-14
No files found.
Poker.java
View file @
1698eabc
...
@@ -103,28 +103,43 @@ public class Poker {
...
@@ -103,28 +103,43 @@ public class Poker {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Carta
carta1
=
new
Carta
(
"
6
S"
);
Carta
carta1
=
new
Carta
(
"
4
S"
);
Carta
carta2
=
new
Carta
(
"
6
D"
);
Carta
carta2
=
new
Carta
(
"
T
D"
);
Carta
carta3
=
new
Carta
(
"
8
H"
);
Carta
carta3
=
new
Carta
(
"
5
H"
);
Carta
carta4
=
new
Carta
(
"8C"
);
Carta
carta4
=
new
Carta
(
"8C"
);
Carta
carta5
=
new
Carta
(
"
8
D"
);
Carta
carta5
=
new
Carta
(
"
3
D"
);
Poker
partida
=
new
Poker
();
Poker
partida
=
new
Poker
();
int
control
=
0
;
//Variable para controlar el ingreso de cartas repetidas
//Le paso los valores con el metodo del profe
//Le paso los valores con el metodo del profe
String
[]
mano
=
new
String
[]{
carta1
.
valorPalo
(),
carta2
.
valorPalo
(),
carta3
.
valorPalo
(),
carta4
.
valorPalo
(),
carta5
.
valorPalo
(),};
String
[]
mano
=
new
String
[]{
carta1
.
valorPalo
(),
carta2
.
valorPalo
(),
carta3
.
valorPalo
(),
carta4
.
valorPalo
(),
carta5
.
valorPalo
(),};
for
(
int
i
=
0
;
i
<
mano
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
mano
.
length
;
i
++)
{
partida
.
setValues
(
mano
[
i
]);
partida
.
setValues
(
mano
[
i
]);
}
}
if
((
partida
.
controlValor
(
partida
.
getValue
())==
""
)
&&
(
partida
.
controlPalos
(
partida
.
getSuit
())==
""
))
{
for
(
int
i
=
0
;
i
<
mano
.
length
;
i
++)
{
System
.
out
.
println
(
"CARTA ALTA"
);
for
(
int
j
=
0
;
j
<
mano
.
length
;
j
++)
{
}
else
{
if
(
mano
[
i
].
equals
(
mano
[
j
]))
{
// System.out.println(partida.getSuit());
control
++;
// System.out.println(partida.getValue());
}
System
.
out
.
print
(
"Sus cartas son: ["
);
for
(
int
i
=
0
;
i
<
mano
.
length
;
i
++)
{
System
.
out
.
print
(
mano
[
i
]
+
","
);
}
}
System
.
out
.
print
(
"]\n"
);
}
System
.
out
.
println
(
partida
.
controlValor
(
partida
.
getValue
())
+
" "
+
partida
.
controlPalos
(
partida
.
getSuit
()));
//Condicional para imprimir los resultados solo si no se encontraron cartas repetidas
if
(
control
==
5
){
if
((
partida
.
controlValor
(
partida
.
getValue
())==
""
)
&&
(
partida
.
controlPalos
(
partida
.
getSuit
())
==
""
))
{
System
.
out
.
println
(
"CARTA ALTA"
);
}
else
{
//Dejo a modo de comentario para posibles comprobaciones o controles
// System.out.println(partida.getSuit());
// System.out.println(partida.getValue());
System
.
out
.
print
(
"Sus cartas son: ["
);
for
(
int
i
=
0
;
i
<
mano
.
length
;
i
++)
{
System
.
out
.
print
(
mano
[
i
]
+
","
);
}
System
.
out
.
print
(
"]\n"
);
System
.
out
.
println
(
partida
.
controlValor
(
partida
.
getValue
())
+
" "
+
partida
.
controlPalos
(
partida
.
getSuit
()));
}
}
else
{
System
.
out
.
println
(
"Jugada invalidas: Se encontraron cartas iguales, por favor intente de nuevo"
);
}
}
}
}
}
}
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