Skip to content
Snippets Groups Projects
Commit ee6b88d5 authored by BiocheH's avatar BiocheH
Browse files

q6 : ajout de coupe (méthode de TabletteChocolat)

parent 4a4db915
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,9 @@ class TabletteChocolat:
def est_possible(self, couple):
return couple in list(self.coups_possibles())
def coupe(self, couple):
return TabletteChocolat(self.m - couple[0], self.n - couple[1])
A = TabletteChocolat(1, 2)
B = TabletteChocolat(4, 8)
......@@ -33,4 +36,5 @@ print(list(B.coups_possibles()))
print(B.coups_possibles())
print(B.est_possible((3, 0)))
print(B.est_possible((3, 2)))
print(B.coupe((0, 5)))
print(B.coupe((2, 0)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment