[Echecs] Correction et amélioration Logique::eNoir
This commit is contained in:
parent
1639150362
commit
555deb4f35
|
@ -20,14 +20,8 @@ class LogiqueEchecs:
|
||||||
self.nvPartie()
|
self.nvPartie()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def eNoir(xD, yD): # TODO Peut être considérablement amélioré
|
def eNoir(xD, yD):
|
||||||
i = 1
|
return xD % 2 != yD % 2
|
||||||
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 cGrille(self):
|
def cGrille(self):
|
||||||
for x in range(CASES_COTE):
|
for x in range(CASES_COTE):
|
||||||
|
|
Reference in a new issue