Browse Source

TeSt

master
Bastien 3 hours ago
parent
commit
3d1843c3f0
  1. 34
      bataille.py

34
bataille.py

@ -1,5 +1,6 @@
from File import File_chaine as File
import random
from time import sleep
class Carte:
"carte"
@ -64,7 +65,32 @@ def partie(jeu1, jeu2):
elif resultat == -1 :
while not gain.est_vide():
jeu2.enfiler(gain.defiler())
"""
def partie_TeSt(j1, j2):
while not (j1.est_vide() or j2.est_vide()):
c1 = j1.defiler()
c2 = j2.defiler()
gain = File()
gain.enfiler(c1)
gain.enfiler(c2)
resultat = c1.compare(c2)
while resultat == 0 and j1.taille() >= 2 and j2.taille() >= 2:
gain.enfiler(j1.defiler())
gain.enfiler(j2.defiler())
c1 = j1.defiler()
c2 = j2.defiler()
gain.enfiler(c1)
gain.enfiler(c2)
resultat = c1.compare(c2)
if resultat == 1:
while not gain.est_vide():
j1.enfiler(gain.defiler())
elif resultat == -1:
while not gain.est_vide():
j2.enfiler(gain.defiler())
else:
"""
Loading…
Cancel
Save