Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examen1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EDEY Codjo vianney carmel
examen1
Commits
b3aaa799
Commit
b3aaa799
authored
5 months ago
by
VianneyCarmel
Browse files
Options
Downloads
Patches
Plain Diff
mon exam
parent
029fd26c
Branches
main
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+63
-0
63 additions, 0 deletions
main.py
with
63 additions
and
0 deletions
main.py
+
63
−
0
View file @
b3aaa799
##### 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
()
#=============================================================
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment