Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alligators-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Benjamin Monmege
Alligators-python
Commits
a5a0974b
Commit
a5a0974b
authored
3 years ago
by
Antonio MATTAR
Browse files
Options
Downloads
Patches
Plain Diff
-Fixed the counter error
parent
6b62d7b8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
image_maker.py
+1
-1
1 addition, 1 deletion
image_maker.py
logic.py
+14
-6
14 additions, 6 deletions
logic.py
with
15 additions
and
7 deletions
image_maker.py
+
1
−
1
View file @
a5a0974b
...
...
@@ -94,7 +94,7 @@ def addNumberToImage(image,number):
# font = ImageFont.truetype(<font-file>, <font-size>)
font
=
ImageFont
.
truetype
(
"
AllerDisplay.ttf
"
,
150
)
# draw.text((x, y),"Sample Text",(r,g,b))
draw
.
text
((
0
,
0
),
str
(
number
+
2
),(
0
,
0
,
0
),
font
=
font
)
draw
.
text
((
5
,
0
),
str
(
number
),(
0
,
0
,
0
),
font
=
font
)
return
image
def
createAppImage
(
terme
):
...
...
This diff is collapsed.
Click to expand it.
logic.py
+
14
−
6
View file @
a5a0974b
...
...
@@ -396,26 +396,34 @@ def beta_reduction_choice_n(terme,n):
if
A2
==
None
and
B2
==
None
:
return
None
def
beta_reduction_interactive
(
terme
):
at
=
annotate_beta_reduction
(
terme
)
def
beta_reduction_interactive
(
terme
,
at
):
global
counters
if
at
!=
None
:
print
(
annotated_to_string
(
at
))
choice
=
int
(
input
(
"
Choose a beta reduction:
"
))
while
choice
<=
0
or
choice
>
counters
:
print
(
"
Invalid choice
"
)
choice
=
int
(
input
(
"
Choose a beta reduction:
"
))
try
:
return
beta_reduction_choice_n
(
at
,
choice
)
finally
:
counters
=
0
else
:
try
:
return
terme
finally
:
counters
=
0
def
beta_reduction_interactive_totale
(
terme
):
if
beta_reduction
((
terme
))
!=
None
:
print
(
to_string
(
terme
))
at
=
(
annotate_beta_reduction
((
terme
)))
captureImage
(
at
)
choix
=
int
(
input
(
"
voulez-vous faire la reduction tapez sur 1 pour oui tapez sur 2 pour non
"
))
if
choix
==
1
:
captureImage
(
annotate_beta_reduction
((
terme
)))
return
beta_reduction_interactive_totale
(
beta_reduction_interactive
(
terme
))
return
beta_reduction_interactive_totale
(
beta_reduction_interactive
(
terme
,
at
))
else
:
print
(
terme
)
captureImage
(
terme
)
print
(
"
C
'
est fini, le terme obtenu est :
"
+
to_string
(
terme
))
else
:
...
...
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