From 216d62d9123d5275f7aa2b01de74d556c1174214 Mon Sep 17 00:00:00 2001 From: "bollet.c" <> Date: Wed, 20 Dec 2023 07:19:47 +0100 Subject: [PATCH] =?UTF-8?q?as=20sup=C3=A9rieur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_interaction.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test_interaction.py b/test_interaction.py index 056741f..76e6ec4 100644 --- a/test_interaction.py +++ b/test_interaction.py @@ -14,10 +14,20 @@ class Carte: def compare(self, other): """comparaison entre deux cartes""" if self.valeur > other.valeur: - return 1 + if other.valeur == 1: + #l'autre a un as donc other est supérieur + return -1 + else: + return 1 + elif self.valeur < other.valeur: - return -1 - return 0 + if self.valeur == 1: + #on a un as donc self est supérieur + return 1 + else: + return -1 + else: + return 0 def affichage(self): """affichage de la carte"""