Skip to content
Snippets Groups Projects
Commit e2e074dc authored by VALLET Armel's avatar VALLET Armel
Browse files

question 9

parent 31b08127
No related branches found
No related tags found
No related merge requests found
...@@ -39,11 +39,14 @@ class TabletteChocolat: ...@@ -39,11 +39,14 @@ class TabletteChocolat:
plt.close() plt.close()
def demander_coup(self): def demander_coup(self):
n = 0
x = input("Couper des lignes (l) ou colonnes (c) ? -> ") x = input("Couper des lignes (l) ou colonnes (c) ? -> ")
if x == "l": if x == "l":
while not self.est_possible(int(n), 0):
n = input("Combien de lignes à couper ? Choix possibles : " + str(list(range(1, self.m))) + " -> ") n = input("Combien de lignes à couper ? Choix possibles : " + str(list(range(1, self.m))) + " -> ")
return t.coupe(int(n), 0) return self.coupe(int(n), 0)
if x == "c": if x == "c":
while not self.est_possible(0, int(n)):
n = input("Combien de colonnes à couper ? Choix possibles : " + str(list(range(1, self.n))) + " -> ") n = input("Combien de colonnes à couper ? Choix possibles : " + str(list(range(1, self.n))) + " -> ")
return t.coupe(0, int(n)) return t.coupe(0, int(n))
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment