Skip to content
Snippets Groups Projects
Commit 5cfa1de0 authored by GUYOT Maelis's avatar GUYOT Maelis
Browse files

question6

parent d0e187fc
No related branches found
No related tags found
No related merge requests found
#Imports éventuels
import itertools as it
import matplotlib as plt
#AJouts de fonctions et méthode
......@@ -17,17 +17,24 @@ class TabletteChocolat:#création de la classe
return "Tablette de chocolat de"+str(self.m)+"x"+str(self.n)
def coups_possibles(self):
h=()
g=[]
for i in range(self.m):
for j in range(self.n):
g.append((i,j))
return g
for h in it.chain(range(self.m),range(self.n)):
g.append(h)
return
def est_possible(self,i,j):
if isinstance((i,j),self.coups_possibles()):
return True
def coupe(self,i,j):
return self.coups_possibles()
#Programme principal
#if __name__=='main':
if True: # __name__=='main':
t = TabletteChocolat(3,4)
g = t.coups_possibles()
print(t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment