Skip to content
Snippets Groups Projects
Commit b3aaa799 authored by VianneyCarmel's avatar VianneyCarmel
Browse files

mon exam

parent 029fd26c
Branches main
No related tags found
No related merge requests found
##### 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()
#=============================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment