diff --git a/main.py b/main.py index 98aa96445279fba2903f34f0f0b9642eeac00ba1..ca22bb7d2818eecb3cf8ccad52bc8dd57a71cfc6 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