diff --git a/main.py b/main.py index 70f1b2e4a23d2f4faa5cf7a6210f49db34b36a73..678729d5b046e2fcca0a111f3552e936056e2d8b 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