From 3758aee18c308ba36e031290e58c28f727aac36d Mon Sep 17 00:00:00 2001 From: Esperance DJOSSOU <esperancegilchrist@gmail.com> Date: Fri, 10 Jan 2025 15:31:21 +0100 Subject: [PATCH] ajout d'un fichier --- main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..52a2a43 --- /dev/null +++ b/main.py @@ -0,0 +1,54 @@ +class TabletteChocolat: + def __init__(self, m,n): + self.m = m: + self.n = n: + + if type(n)==and type(n)==int ; + self.lignes =n + self. colonne = m + else : False= typeEroordef + def_str_(self) + return ("Tablette de chocolat de "+str(self.lignes) + "x" + str(self.colonnes") + def _repr_(self): + return (("Tablette de chocolat de "+str(self.lignes) + "x" + str(self.colonnes")) + def corps_possible(self) + return ((itertools.clain(i,0) for i in range(0,self.ligne)). (0,j) for j in range(0,self.colonnes)) + + def coups (self, i,n) + i= [] + for i in range(self.lignes -i, self.colonnes -j) + + + def plot (self) : + i=[] + for i in range(self) + plt.show + plt.gca() set.aspect('equal') + pit.axis ('off') + + def demander_coup(self) : + a= input(str)("voulew vous couper des lignes (l) ou des colonnes c ") + if a== "l" + g=self.coups_passibles() + print(list (g)) + g=input ("combien de lignes voulez vous coupoer") + if int(b),0) est possible : + return (int(b), 0) + else : self(demain_coups) + return a==c + def plot (self) + + + + + + + + + + + + + + + \ No newline at end of file -- GitLab