From fc3a5a8b9bcf500cde4c43f3c474c6dfd71588f0 Mon Sep 17 00:00:00 2001 From: v21235334 <jonathan.villa@etu.univ-amu.fr> Date: Fri, 10 Jan 2025 14:30:25 +0100 Subject: [PATCH] question 5 14h30 --- main.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 98aa964..ca22bb7 100644 --- a/main.py +++ b/main.py @@ -18,10 +18,19 @@ class TabletteChocolat: for j in range(1,self.n): g.append((0,j)) return g + def est_possible(self,i,j): + g=TabletteChocolat.coups_possibles(self) + if (i,j) in g: + return ("ce coup est possible") + else: + return("ce coup est impossible") + + T1=TabletteChocolat(3,4) T2=TabletteChocolat(1.5,7) - -g = T1.coups_possibles() \ No newline at end of file +g = T1.coups_possibles() +print(T1.est_possible(2,0)) +print(T1.est_possible(3,0)) \ No newline at end of file -- GitLab