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
Emanuel Lugo
poker
Commits
89deb808
Commit
89deb808
authored
Apr 27, 2022
by
Emanuel Lugo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
poker2
parent
c6fc3fec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletions
+67
-1
poker/Carta.java
+1
-1
poker2/PokerGame2.java
+66
-0
No files found.
poker/Carta.java
View file @
89deb808
...
...
@@ -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"
))
{
...
...
poker2/PokerGame2.java
View file @
89deb808
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
;
}
}
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