-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
33 lines (32 loc) · 1.3 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from Partie import Partie
from mtd import MTD
partie = Partie("Test","Aucun")
partie.afficherListePion()
play=True
while play:
name=input("Selectionnez un pion (Entrez \"Fin\" pour arrêter le test):\n")
if partie.getPion(name):
listeDep=partie.getDeplacement(partie.getPion(name))
listeCap=partie.getCapture(partie.getPion(name))
if(listeCap):
print("Capture possible : "+str(partie.getCapture(partie.getPion(name))))
x=input("Coordonnées X :\n")
y=input("Coordonnées Y :\n")
partie.effectuerDeplacement(int(x),int(y),partie.getPion(name))
partie.damier.afficher_matrice()
elif(listeDep):
print("Déplacement possible : "+str(partie.getDeplacement(partie.getPion(name))))
x=input("Coordonnées X :\n")
y=input("Coordonnées Y :\n")
partie.effectuerDeplacement(int(x),int(y),partie.getPion(name))
partie.damier.afficher_matrice()
else:
print("Pas de déplacement possible pour "+name)
elif name=="Fin":
play=False
x=MTD(partie,"noir",5,0)
y=x[1]
print("Meilleur coup pour les noirs : "+str(y))
partie.effectuerDeplacement(y[0],y[1],partie.getPion(y[2]))
partie.damier.afficher_matrice()
partie.afficherListePion()