Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kotlin-e004-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
Yannine Alvarez
kotlin-e004-poker
Commits
d69ced50
Commit
d69ced50
authored
Apr 20, 2020
by
Yannine Alvarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregar la funciòn verificar las cartas para ganador
parent
c7f9007f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
Poker/.idea/workspace.xml
+4
-4
Poker/src/Poker.kt
+2
-3
No files found.
Poker/.idea/workspace.xml
View file @
d69ced50
...
@@ -135,10 +135,10 @@
...
@@ -135,10 +135,10 @@
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
<state
x=
"413"
y=
"109"
key=
"#com.intellij.refactoring.typeMigration.ui.FailedConversionsDialog/0.0.1366.728@0.0.1366.728"
timestamp=
"1586915044775"
/>
<state
x=
"413"
y=
"109"
key=
"#com.intellij.refactoring.typeMigration.ui.FailedConversionsDialog/0.0.1366.728@0.0.1366.728"
timestamp=
"1586915044775"
/>
<state
x=
"313"
y=
"0"
key=
"CommitChangelistDialog2"
timestamp=
"158743
3848146
"
>
<state
x=
"313"
y=
"0"
key=
"CommitChangelistDialog2"
timestamp=
"158743
4440282
"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
<state
x=
"313"
y=
"0"
key=
"CommitChangelistDialog2/0.0.1366.728@0.0.1366.728"
timestamp=
"158743
3848146
"
/>
<state
x=
"313"
y=
"0"
key=
"CommitChangelistDialog2/0.0.1366.728@0.0.1366.728"
timestamp=
"158743
4440282
"
/>
<state
width=
"1322"
height=
"145"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1587433392572"
>
<state
width=
"1322"
height=
"145"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1587433392572"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
...
@@ -171,10 +171,10 @@
...
@@ -171,10 +171,10 @@
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
<state
width=
"1322"
height=
"217"
key=
"GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728"
timestamp=
"1587426755633"
/>
<state
width=
"1322"
height=
"217"
key=
"GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728"
timestamp=
"1587426755633"
/>
<state
x=
"275"
y=
"95"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"158743
385852
7"
>
<state
x=
"275"
y=
"95"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"158743
446256
7"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
<state
x=
"275"
y=
"95"
key=
"Vcs.Push.Dialog.v2/0.0.1366.728@0.0.1366.728"
timestamp=
"158743
385852
7"
/>
<state
x=
"275"
y=
"95"
key=
"Vcs.Push.Dialog.v2/0.0.1366.728@0.0.1366.728"
timestamp=
"158743
446256
7"
/>
<state
x=
"92"
y=
"92"
width=
"1182"
height=
"544"
key=
"com.intellij.history.integration.ui.views.FileHistoryDialog"
timestamp=
"1587430678418"
>
<state
x=
"92"
y=
"92"
width=
"1182"
height=
"544"
key=
"com.intellij.history.integration.ui.views.FileHistoryDialog"
timestamp=
"1587430678418"
>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
<screen
x=
"0"
y=
"0"
width=
"1366"
height=
"728"
/>
</state>
</state>
...
...
Poker/src/Poker.kt
View file @
d69ced50
...
@@ -54,21 +54,20 @@ class OrdenarCartas {
...
@@ -54,21 +54,20 @@ class OrdenarCartas {
fun
esAnterior
(
carta1
:
Carta
,
carta2
:
Carta
):
Boolean
{
fun
esAnterior
(
carta1
:
Carta
,
carta2
:
Carta
):
Boolean
{
var
valor1
=
0
var
valor1
=
0
var
valor2
=
0
var
valor2
=
0
//Buscamos la posicion del valor de la otra carta
for
(
i
in
valores
.
indices
)
{
for
(
i
in
valores
.
indices
)
{
if
(
carta1
.
valorPalo
()[
0
]
==
valores
[
i
])
{
if
(
carta1
.
valorPalo
()[
0
]
==
valores
[
i
])
{
valor1
=
i
valor1
=
i
break
break
}
}
}
}
//Buscamos la posicion del valor de esta carta
for
(
i
in
valores
.
indices
)
{
for
(
i
in
valores
.
indices
)
{
if
(
carta2
.
valorPalo
()[
0
]
==
valores
[
i
])
{
if
(
carta2
.
valorPalo
()[
0
]
==
valores
[
i
])
{
valor2
=
i
valor2
=
i
break
break
}
}
}
}
//averiguamos si es el siguiente
return
if
(
valor1
!=
valor2
+
1
)
{
return
if
(
valor1
!=
valor2
+
1
)
{
false
false
}
else
true
}
else
true
...
...
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