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

question 8

parent fdde8478
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,17 @@ class TabletteChocolat:
plt.show()
plt.close()
def demander_coup(self):
x = input("Couper des lignes (l) ou colonnes (c) ? -> ")
if x == "l":
n = input("Combien de lignes à couper ? Choix possibles : " + str(list(range(1, self.m))) + " -> ")
return t.coupe(int(n), 0)
if x == "c":
n = input("Combien de colonnes à couper ? Choix possibles : " + str(list(range(1, self.n))) + " -> ")
return t.coupe(0, int(n))
else:
return "Il faut répondre l ou c !"
# Programme principal
t = TabletteChocolat(4, 3)
......@@ -47,3 +58,4 @@ print(t.coups_possibles())
print(t.est_possible(0, 1))
print(t.coupe(3, 1))
t.plot()
print(t.demander_coup())
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment