Commit d69ced50 by Yannine Alvarez

Agregar la funciòn verificar las cartas para ganador

parent c7f9007f
......@@ -135,10 +135,10 @@
<screen x="0" y="0" width="1366" height="728" />
</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="313" y="0" key="CommitChangelistDialog2" timestamp="1587433848146">
<state x="313" y="0" key="CommitChangelistDialog2" timestamp="1587434440282">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="313" y="0" key="CommitChangelistDialog2/0.0.1366.728@0.0.1366.728" timestamp="1587433848146" />
<state x="313" y="0" key="CommitChangelistDialog2/0.0.1366.728@0.0.1366.728" timestamp="1587434440282" />
<state width="1322" height="145" key="GridCell.Tab.0.bottom" timestamp="1587433392572">
<screen x="0" y="0" width="1366" height="728" />
</state>
......@@ -171,10 +171,10 @@
<screen x="0" y="0" width="1366" height="728" />
</state>
<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="1587433858527">
<state x="275" y="95" key="Vcs.Push.Dialog.v2" timestamp="1587434462567">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="275" y="95" key="Vcs.Push.Dialog.v2/0.0.1366.728@0.0.1366.728" timestamp="1587433858527" />
<state x="275" y="95" key="Vcs.Push.Dialog.v2/0.0.1366.728@0.0.1366.728" timestamp="1587434462567" />
<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" />
</state>
......
......@@ -54,21 +54,20 @@ class OrdenarCartas {
fun esAnterior(carta1: Carta, carta2: Carta): Boolean {
var valor1 = 0
var valor2 = 0
//Buscamos la posicion del valor de la otra carta
for (i in valores.indices) {
if (carta1.valorPalo()[0] == valores[i]) {
valor1 = i
break
}
}
//Buscamos la posicion del valor de esta carta
for (i in valores.indices) {
if (carta2.valorPalo()[0] == valores[i]) {
valor2 = i
break
}
}
//averiguamos si es el siguiente
return if (valor1 != valor2 + 1) {
false
} else true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment