diff --git a/main.py b/main.py index 9b248bd783a92a897829dd3aa7277180d638d199..4d95652b0360cefb2b7306da044903ace0879126 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ from itertools import chain + class TabletteChocolat : def __init__(self, m:int, n:int): ''' @@ -24,9 +25,12 @@ class TabletteChocolat : resultat.append(0, i) return chain(resultat) - def est_possible(self, i, j) : + def est_possible(self, couple_i_j) : '''cette méthode prend en paramètres un couple i et j, les coordonées du carreau, et revoie si le coup en ces coordonnées est possible''' - return couple in list(self.coups_possibles()) + return couple_i_j in list(self.coups_possibles()) + + def coupe(self, couple_i_j) : + return TabletteChocolat(self.m - couple_i_j[0] , self.n - couple_i_j[1])