From 4bc119bb4de2412096dee6915bdcb20b43f0b456 Mon Sep 17 00:00:00 2001 From: Armel Vallet <armel.vallet@etu.univ-amu.fr> Date: Fri, 10 Jan 2025 13:46:59 +0100 Subject: [PATCH] question 6 --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 85dbc37..d92f25d 100644 --- a/main.py +++ b/main.py @@ -22,10 +22,14 @@ class TabletteChocolat: def est_possible(self, i, j): return (i, j) in self.coups_possibles() + def coupe(self, i, j): + return TabletteChocolat(self.m - i, self.n - j) + # Programme principal t = TabletteChocolat(5, 2) print(t) TabletteChocolat(3, 4) print(t.coups_possibles()) -print(t.est_possible(0, 1)) \ No newline at end of file +print(t.est_possible(0, 1)) +print(t.coupe(3, 1)) \ No newline at end of file -- GitLab