From 555deb4f35818b4092743094b07382485f3b1fcb Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 6 Dec 2014 23:29:55 +0100 Subject: [PATCH] =?UTF-8?q?[Echecs]=20Correction=20et=20am=C3=A9lioration?= =?UTF-8?q?=20Logique::eNoir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- S1/Echecs/echecs.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/S1/Echecs/echecs.py b/S1/Echecs/echecs.py index d0bc621..f0d84c0 100755 --- a/S1/Echecs/echecs.py +++ b/S1/Echecs/echecs.py @@ -20,14 +20,8 @@ class LogiqueEchecs: self.nvPartie() @staticmethod - def eNoir(xD, yD): # TODO Peut être considérablement amélioré - i = 1 - for x in range(0, CASES_COTE): - i += 1 - for y in range(0, CASES_COTE): - i += 1 - if x == xD and y == yD: - return i % 2 + def eNoir(xD, yD): + return xD % 2 != yD % 2 def cGrille(self): for x in range(CASES_COTE):