diff --git a/main.py b/main.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f1bcdebc9b90d6ecef6c7c2785713e82dc4e17db 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,63 @@ +##### EXAMEN FINAL INFORMATIQUE +##NOM ET PRENOMS : EDEY CARMEL +#================================================================= +#Les imports +import math +import tkinter as tkinter +import numpy as np +import matplotlib.pyplot as plt +import itertools as iter +#***** +#==== Corps du progrqmme ===================================== +class TabletteChocolat : + def __init__(self,m,n): + self.m=m + self.n=n + + if not instance(n,int) and instance(m,int) : + raise TypeError("les entrées m et n doivent êtres des entiers") + + + def __str__(self): + return (f"Tablette de chocolat de : {self.m} et de {self.n}") + + + def coupe (self, cpl : typle): + return TabletteChocolat(self, n-cpl(0), self.n-cpl(1)) + + def plot(self): + plt.gca().set_aspect('equal') + plt.axis('off') + plt.fill([0,self.n, self.m, 0], [0,0, self.n, self.n, 0], color = '06995') + for j in range (self.n) : + for k in range (self.n) : + plt.plot([1+0.1, 1+0.9, 1+0,1],[1+0.1, 1+0.9, 1+0,1],[1+0.1, 1+0.9, 1+0,1]) + + + def coups_possibles(): + + def est_possible(i,j): + + + + def demander_coup(): + + + def first_player_has_a_winning_strategy() : + + + # ====Exécution du programme = ====================================== + +instance1 = TabletteChocolat (3,4) +instance2 = TabletteChocolat (4,3) +print(instance1) +print(instance2) + + + if __name__ == "__main__": + import doctest + doctest.testmod() + + +#============================================================= +