Skip to content
Snippets Groups Projects
Commit 8d88a74e authored by BAHOU Mehdi's avatar BAHOU Mehdi
Browse files

Question 9

parent 0db86b35
Branches
No related tags found
No related merge requests found
...@@ -77,18 +77,17 @@ class TabletteChocolat: ...@@ -77,18 +77,17 @@ class TabletteChocolat:
if demande == 'l': if demande == 'l':
while(True): while(True):
reponse = int(input("Combien ? En sachant qu'il y a " + str(self.m-1) +" possibilités")) reponse = int(input("Combien ? En sachant qu'il y a " + str(self.m-1) +" possibilités"))
if 1 <= reponse < self.m -1: if 1 <= reponse < self.m:
return (reponse,0) return (reponse,0)
else: else:
print('coup non valide') print('coup non valide')
elif demande == 'c': elif demande == 'c':
while(True): while(True):
reponse = int(input("Combien ? En sachant qu'il y a "+ str(self.n - 1)+ " possibilités")) reponse = int(input("Combien ? En sachant qu'il y a "+ str(self.n - 1)+ " possibilités"))
if 1 <= reponse < self.m -1: if 1 <= reponse < self.n:
return (0,reponse) return (0,reponse)
else: else:
print('coup non valide') print('coup non valide')
#Programme Principal #Programme Principal
Tablette = TabletteChocolat(4,3) Tablette = TabletteChocolat(4,3)
...@@ -97,5 +96,3 @@ g= Tablette.coups_possibles() ...@@ -97,5 +96,3 @@ g= Tablette.coups_possibles()
print(list(g)) print(list(g))
print(Tablette.est_possible(1,0)) print(Tablette.est_possible(1,0))
biscuit = Tablette.coupe(1,0) biscuit = Tablette.coupe(1,0)
Tablette.plot()
print(Tablette.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