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

final i think

parent 8a0a09a3
No related branches found
No related tags found
No related merge requests found
...@@ -31,11 +31,12 @@ class TabletteChocolat: ...@@ -31,11 +31,12 @@ class TabletteChocolat:
return TabletteChocolat(self.m - i, self.n - j) return TabletteChocolat(self.m - i, self.n - j)
def plot(self): def plot(self):
plt.fill((0, self.n, self.n, 0, 0), (0, 0, self.m, self.m, 0), color='brown')
for i in range(self.n): for i in range(self.n):
for j in range(self.m): for j in range(self.m):
plt.plot((i, i+1, i+1, i, i), (j, j, j+1, j+1, j), color='black') plt.plot((i+0.1, i+0.9, i+0.9, i+0.1, i+0.1), (j+0.1, j+0.1, j+0.9, j+0.9, j+0.1), color='black')
if i == self.n -1 and j == 0: if i == self.n -1 and j == 0:
plt.fill((i, i + 1, i + 1, i, i), (j, j, j + 1, j + 1, j), color='black') plt.fill((i+0.1, i+0.9, i+0.9, i+0.1, i+0.1), (j+0.1, j+0.1, j+0.9, j+0.9, j+0.1), color='black')
plt.gca().set_aspect('equal') plt.gca().set_aspect('equal')
plt.axis('off') plt.axis('off')
plt.show() plt.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment