Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Examen
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LITAIZE Leo
Examen
Commits
c963b29e
Commit
c963b29e
authored
5 months ago
by
Leo Litaize
Browse files
Options
Downloads
Patches
Plain Diff
Question 5; et question 2 changée
parent
1eb234eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+5
-3
5 additions, 3 deletions
main.py
with
5 additions
and
3 deletions
main.py
+
5
−
3
View file @
c963b29e
import
matplotlib.pyplot
as
plt
from
itertools
import
chain
as
ch
from
itertools
import
chain
as
ch
class
TabletteChocolat
:
class
TabletteChocolat
:
def
__init__
(
self
,
m
,
n
):
def
__init__
(
self
,
m
,
n
):
...
@@ -6,13 +7,14 @@ class TabletteChocolat:
...
@@ -6,13 +7,14 @@ class TabletteChocolat:
try
:
try
:
self
.
m
==
int
and
self
.
n
==
int
self
.
m
==
int
and
self
.
n
==
int
except
:
except
:
raise
TypeError
(
"
Rentrer des entiers
"
)
TypeError
,
print
(
"
Rentrer des entiers
"
)
def
__str__
(
self
):
def
__str__
(
self
):
return
"
(
"
+
str
(
self
.
m
)
+
"
x
"
+
str
(
self
.
n
)
+
"
)
"
return
"
(
"
+
str
(
self
.
m
)
+
"
x
"
+
str
(
self
.
n
)
+
"
)
"
def
__repr__
(
self
):
def
__repr__
(
self
):
return
str
(
self
)
return
"
Tablette de chocolat de
"
+
str
(
self
.
n
)
+
"
x
"
+
str
(
self
.
m
)
+
"
)
"
def
coups_possibles
(
self
):
def
coups_possibles
(
self
):
for
i
in
range
(
self
.
m
):
for
i
in
range
(
self
.
m
):
for
j
in
range
(
self
.
n
):
for
j
in
range
(
self
.
n
):
...
@@ -23,7 +25,6 @@ class TabletteChocolat:
...
@@ -23,7 +25,6 @@ class TabletteChocolat:
#return itertools.chain ??????
#return itertools.chain ??????
#help(itertools.chain) ??????
#help(itertools.chain) ??????
def
est_possible
(
self
,
i
,
j
):
def
est_possible
(
self
,
i
,
j
):
for
a
in
list
(
g
):
for
a
in
list
(
g
):
if
a
==
(
i
,
j
):
if
a
==
(
i
,
j
):
...
@@ -31,6 +32,7 @@ class TabletteChocolat:
...
@@ -31,6 +32,7 @@ class TabletteChocolat:
else
:
else
:
return
"
Ce coup n est pas possible
"
return
"
Ce coup n est pas possible
"
#def coupe(self,i,j):
...
...
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