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
dfe88611
Commit
dfe88611
authored
Apr 26, 2022
by
Josebaezx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agrego metodo trio
parent
3944d7cf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
5 deletions
+61
-5
.idea/runConfigurations.xml
+11
-0
Juego.java
+34
-0
Main.java
+5
-5
out/production/poker/.idea/runConfigurations.xml
+11
-0
out/production/poker/Juego.class
+0
-0
out/production/poker/Main.class
+0
-0
No files found.
.idea/runConfigurations.xml
0 → 100644
View file @
dfe88611
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RunConfigurationProducerService"
>
<option
name=
"ignoredProducers"
>
<set>
<option
value=
"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer"
/>
</set>
</option>
</component>
</project>
\ No newline at end of file
Juego.java
View file @
dfe88611
...
@@ -31,10 +31,44 @@ public class Juego {
...
@@ -31,10 +31,44 @@ public class Juego {
siguiente
=
false
;
siguiente
=
false
;
System
.
out
.
println
(
"COLOR"
);
System
.
out
.
println
(
"COLOR"
);
}
}
if
(
siguiente
&&
trio
(
cartas
))
{
siguiente
=
false
;
System
.
out
.
println
(
"TRIO"
);
}
if
(
siguiente
)
{
if
(
siguiente
)
{
System
.
out
.
println
(
"NADA"
);
System
.
out
.
println
(
"NADA"
);
}
}
}
}
public
boolean
trio
(
List
<
Carta
>
cartas
)
{
List
<
Integer
>
valores
=
new
ArrayList
<>();
for
(
Carta
c
:
cartas
)
{
valores
.
add
(
extraer
(
c
.
valor
));
}
//Collections.sort(valores);
int
counter
=
0
;
int
numero
=
0
;
int
cantidadNumero
=
0
;
for
(
int
i
=
11
;
i
<
14
;
i
++){
for
(
int
j
=
0
;
j
<
valores
.
size
();
j
++)
{
int
s
=
valores
.
get
(
j
);
if
(
s
==
i
){
counter
++;
}
}
if
(
counter
>
cantidadNumero
){
numero
=
i
;
cantidadNumero
=
counter
;
}
counter
=
0
;
}
if
(
cantidadNumero
==
3
){
return
true
;
}
else
{
return
false
;
}
}
//Dos cartas iguales (mismo valor) junto con tres cartas iguales (mismo valor).
//Dos cartas iguales (mismo valor) junto con tres cartas iguales (mismo valor).
public
boolean
full
(
List
<
Carta
>
cartas
)
{
public
boolean
full
(
List
<
Carta
>
cartas
)
{
List
<
Integer
>
valores
=
new
ArrayList
<>();
List
<
Integer
>
valores
=
new
ArrayList
<>();
...
...
Main.java
View file @
dfe88611
...
@@ -9,11 +9,11 @@ public class Main {
...
@@ -9,11 +9,11 @@ public class Main {
List
<
Carta
>
cartas
=
new
ArrayList
<>();
List
<
Carta
>
cartas
=
new
ArrayList
<>();
cartas
=
Arrays
.
asList
(
cartas
=
Arrays
.
asList
(
new
Carta
(
"
2
H"
),
new
Carta
(
"
Q
H"
),
new
Carta
(
"
2
H"
),
new
Carta
(
"
Q
H"
),
new
Carta
(
"
7
H"
),
new
Carta
(
"
Q
H"
),
new
Carta
(
"
7
S"
),
new
Carta
(
"
5
S"
),
new
Carta
(
"
7H
"
)
new
Carta
(
"
9C
"
)
);
);
cartas
.
forEach
(
System
.
out
::
print
);
cartas
.
forEach
(
System
.
out
::
print
);
...
...
out/production/poker/.idea/runConfigurations.xml
0 → 100644
View file @
dfe88611
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RunConfigurationProducerService"
>
<option
name=
"ignoredProducers"
>
<set>
<option
value=
"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer"
/>
</set>
</option>
</component>
</project>
\ No newline at end of file
out/production/poker/Juego.class
View file @
dfe88611
No preview for this file type
out/production/poker/Main.class
View file @
dfe88611
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