Je m'étais rabattu sur cette solution car Python me met une erreur de syntaxe avec AND et OR.
if ((insert_piece["N"] == piece_vois[g[0]]) OR (piece_vois[g[0]] == "x")) AND (insert_piece["E"] == piece_vois[g[1]] OR (piece_vois[g[1]] == "x")) AND (insert_piece["S"] == piece_vois[g[2]] OR (piece_vois[g[2]] == "x")) AND (insert_piece["O"] == piece_vois[g[3]] OR (piece_vois[g[3]] == "x")):
erreur
if ((insert_piece["N"] == piece_vois[g[0]]) OR (piece_vois[g[0]] == "x")) AND ((insert_piece["E"] == piece_vois[g[1]]) OR (piece_vois[g[1]] == "x")) AND ((insert_piece["S"] == piece_vois[g[2]]) OR (piece_vois[g[2]] == "x")) AND ((insert_piece["O"] == piece_vois[g[3]]) OR (piece_vois[g[3]] == "x")):
^
SyntaxError: invalid syntax
offset 58, c'est à dire au niveau du premier OR
Partager