From c7ac3de2294d59e426a04e8bf0564ec65ab088e1 Mon Sep 17 00:00:00 2001 From: Fares_AZOUAOUI <fares.azouaoui@gmail.com> Date: Fri, 10 Jan 2025 14:05:06 +0100 Subject: [PATCH] =?UTF-8?q?petite=20correction=20de=20la=20m=C3=A9thode=20?= =?UTF-8?q?coups=5Fpossibles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 70f1b2e..678729d 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ from itertools import chain -import matplotlib.pyplot as plt +#import matplotlib.pyplot as plt class TabletteChocolat : def __init__(self, m:int, n:int): @@ -27,9 +27,9 @@ class TabletteChocolat : ''' resultat = [] for i in range (1 ,self.n) : - resultat.append(i, 0) + resultat.append((i, 0)) for k in range (1, self.m) : - resultat.append(0, j) + resultat.append((0, k)) return chain(resultat) def est_possible(self, couple_i_j) : @@ -41,13 +41,16 @@ class TabletteChocolat : def plot(self) : plt.gca().set_aspect('equal') plt.axis('off') - plt.fill([0, self.m, self.n, 0],) + plt.fill([0, self.m, self.n, 0] , [0, 0, self.m, self.n] , color='#D5B799') + + plt.show t = TabletteChocolat(3,4) print(t) +print(list(t.coups_possibles())) if __name__ == "main" : import doctest -- GitLab