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
Jose Baez
poker
Commits
3a62474d
Commit
3a62474d
authored
Apr 27, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se mejora presentacion en la clase main
parent
8183c0aa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
Juego.java
+5
-6
Main.java
+2
-2
out/production/poker/Juego.class
+0
-0
out/production/poker/Main.class
+0
-0
No files found.
Juego.java
View file @
3a62474d
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -71,7 +70,7 @@ public class Juego {
//Dos cartas iguales (mismo valor) junto con tres cartas iguales (mismo valor).
public
boolean
full
(
List
<
Carta
>
cartas
)
{
if
(
comprobarP
oker
(
cartas
)==
3
){
if
(
comprobarP
alo
(
cartas
)==
3
){
List
<
Integer
>
valores
=
new
ArrayList
<>();
for
(
Carta
c
:
cartas
)
{
valores
.
add
(
extraer
(
c
.
valor
));
...
...
@@ -97,9 +96,9 @@ public class Juego {
//Cuatro cartas iguales (mismo valor).
public
boolean
poker
(
List
<
Carta
>
cartas
)
{
if
(
comprobarP
oker
(
cartas
)==
4
){
if
(
comprobarP
alo
(
cartas
)==
4
){
List
<
Integer
>
valores
=
new
ArrayList
<>();
comprobarP
oker
(
cartas
);
comprobarP
alo
(
cartas
);
for
(
Carta
c
:
cartas
)
{
valores
.
add
(
extraer
(
c
.
valor
));
}
...
...
@@ -131,7 +130,7 @@ public class Juego {
}
}
private
int
comprobarP
oker
(
List
<
Carta
>
cartas
)
{
private
int
comprobarP
alo
(
List
<
Carta
>
cartas
)
{
int
contador
=
0
;
for
(
Carta
c:
cartas
)
{
...
...
@@ -171,7 +170,7 @@ public class Juego {
valores
.
add
(
extraer
(
c
.
valor
));
}
Collections
.
sort
(
valores
);
valores
.
forEach
(
System
.
out
::
println
);
//
valores.forEach(System.out::println);
int
[]
valoresArry
=
pasarAArray
(
valores
);
for
(
int
i
=
0
;
i
<
valoresArry
.
length
-
1
;
i
++)
{
...
...
Main.java
View file @
3a62474d
...
...
@@ -19,8 +19,8 @@ public class Main {
cartas
.
forEach
(
System
.
out
::
print
);
cartas
.
sort
(
Comparator
.
comparing
(
carta
->
carta
.
valor
));
System
.
out
.
println
();
cartas
.
forEach
(
System
.
out
::
print
);
System
.
out
.
println
();
//
cartas.forEach(System.out::print);
//
System.out.println();
j
.
juegosPosibles
(
cartas
);
...
...
out/production/poker/Juego.class
View file @
3a62474d
No preview for this file type
out/production/poker/Main.class
View file @
3a62474d
No preview for this file type
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