Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dia006
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
Joel Florentin
dia006
Commits
7dcf18ae
Commit
7dcf18ae
authored
Oct 25, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed poker probability
parent
bdddb4d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
Poker.java
+17
-11
No files found.
Poker.java
View file @
7dcf18ae
...
...
@@ -67,56 +67,62 @@ public class Poker{
}
public
static
boolean
esTrio
(
Carta
[]
mano
)
{
int
conta
=
0
;
int
conta
=
0
,
max
=
0
;
int
i
;
for
(
i
=
0
;
i
<
mano
.
length
-
1
;
i
++)
{
if
(
mano
[
i
].
getValor
()
==
mano
[
i
+
1
].
getValor
()){
conta
++;
}
else
{
break
;
conta
=
0
;
}
if
(
conta
>
max
)
max
=
conta
;
}
return
(
conta
)==
2
;
return
(
max
)==
2
;
}
public
static
boolean
esDoblePareja
(
Carta
[]
mano
)
{
int
conta
=
0
;
int
contb
=
0
;
int
conta
=
0
,
maxa
=
0
;
int
contb
=
0
,
maxb
=
0
;
int
i
;
for
(
i
=
0
;
i
<
mano
.
length
-
1
;
i
++)
{
if
(
mano
[
i
].
getValor
()
==
mano
[
i
+
1
].
getValor
()){
conta
++;
}
else
{
break
;
conta
=
0
;
}
if
(
conta
>
maxa
)
maxa
=
conta
;
if
(
maxa
==
1
)
break
;
}
for
(
i
=
i
+
1
;
i
<
mano
.
length
-
1
;
i
++)
{
if
(
mano
[
i
].
getValor
()
==
mano
[
i
+
1
].
getValor
()){
contb
++;
}
else
{
break
;
contb
=
0
;
}
if
(
contb
>
maxb
)
maxb
=
contb
;
}
return
conta
==
contb
&&
conta
==
1
;
return
maxa
==
maxb
&&
maxb
==
1
;
}
public
static
boolean
esDoble
(
Carta
[]
mano
)
{
int
conta
=
0
;
int
conta
=
0
,
max
=
0
;
int
i
;
for
(
i
=
0
;
i
<
mano
.
length
-
1
;
i
++)
{
if
(
mano
[
i
].
getValor
()
==
mano
[
i
+
1
].
getValor
()){
conta
++;
}
else
{
break
;
conta
=
0
;
}
if
(
conta
>
max
)
max
=
conta
;
}
return
(
conta
)==
1
;
return
(
max
)==
1
;
}
public
static
boolean
esColor
(
Carta
[]
mano
)
{
...
...
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