From c47b2fad697ed21fbac16857f29a29a6e989f801 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 7 Dec 2014 12:49:33 +0100 Subject: [PATCH] [Echecs] Ajout mvt Cavalier --- S1/Echecs/echecs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/S1/Echecs/echecs.py b/S1/Echecs/echecs.py index f0d84c0..c388873 100755 --- a/S1/Echecs/echecs.py +++ b/S1/Echecs/echecs.py @@ -131,7 +131,10 @@ class LogiqueEchecs: return MVT_N_AUTORISE def mvtPossibleCavalier(self, x1, y1, x2, y2): - return MVT_PION_INC + if (abs(x2-x1) == 2 and abs(y2-y1) == 1) or (abs(y2-y1) == 2 and abs(x2-x1) == 1): + return MVT_OK + else: + return MVT_N_AUTORISE def mvtPossible(self, x1, y1, x2, y2): pion = self.grille[x1][y1]