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
48855d4c
Commit
48855d4c
authored
3 years ago
by
Tamazouzt AIT ELDJOUDI
Browse files
Options
Downloads
Patches
Plain Diff
added the file app_functions
parent
2235f4f7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
AllerDisplay_Std_Rg.ttf
+0
-0
0 additions, 0 deletions
AllerDisplay_Std_Rg.ttf
app_functions.py
+39
-0
39 additions, 0 deletions
app_functions.py
image_maker.py
+1
-1
1 addition, 1 deletion
image_maker.py
with
40 additions
and
1 deletion
AllerDisplay_Std_Rg.ttf
0 → 100644
+
0
−
0
View file @
48855d4c
File added
This diff is collapsed.
Click to expand it.
app_functions.py
0 → 100644
+
39
−
0
View file @
48855d4c
from
logic
import
*
from
parsing
import
*
from
image_maker
import
*
f
=
new_var
(
freshVar
())
x
=
new_var
(
freshVar
())
y
=
new_var
(
freshVar
())
# z=new_var(freshVar())
# w=new_var(freshVar())
boolean
=
{
True
:
new_abs
(
x
,
new_abs
(
y
,
x
)),
False
:
new_abs
(
x
,
new_abs
(
y
,
y
))}
#definition des entiers de church
def
dec_to_church
(
entier
):
if
entier
==
0
:
return
new_abs
(
f
,
new_abs
(
x
,
x
))
else
:
term
=
new_app
(
f
,
x
)
while
entier
>
1
:
term
=
new_app
(
f
,
term
)
entier
-=
1
return
new_abs
(
f
,
new_abs
(
x
,
term
))
def
pair
(
A
,
B
):
return
new_abs
(
f
,
new_app
(
new_app
(
f
,
A
),
B
))
def
getFirstFromPair
(
p
):
return
beta_reduction_totale
(
new_app
(
p
,
boolean
[
True
]))
def
getSecondFromPair
(
p
):
return
beta_reduction_totale
(
new_app
(
p
,
boolean
[
False
]))
def
dec_to_lambda_relative_integers
(
number
):
if
number
>=
0
:
return
pair
(
boolean
[
True
],
dec_to_church
(
number
))
return
pair
(
boolean
[
False
],
dec_to_church
(
number
))
#print(to_string(getSecondFromPair(pair(boolean[True],dec_to_church(1)))))
print
(
to_string
(
pair
(
x
,
y
)))
This diff is collapsed.
Click to expand it.
image_maker.py
+
1
−
1
View file @
48855d4c
...
@@ -98,7 +98,7 @@ def createOldAlligatorFamily(terme):
...
@@ -98,7 +98,7 @@ def createOldAlligatorFamily(terme):
def
addNumberToImage
(
image
,
number
):
def
addNumberToImage
(
image
,
number
):
draw
=
ImageDraw
.
Draw
(
image
.
image
)
draw
=
ImageDraw
.
Draw
(
image
.
image
)
# font = ImageFont.truetype(<font-file>, <font-size>)
# font = ImageFont.truetype(<font-file>, <font-size>)
font
=
ImageFont
.
truetype
(
"
AllerDisplay.ttf
"
,
150
)
font
=
ImageFont
.
truetype
(
"
AllerDisplay
_Std_Rg
.ttf
"
,
150
)
# draw.text((x, y),"Sample Text",(r,g,b))
# draw.text((x, y),"Sample Text",(r,g,b))
draw
.
text
((
5
,
0
),
str
(
number
),(
0
,
0
,
0
),
font
=
font
)
draw
.
text
((
5
,
0
),
str
(
number
),(
0
,
0
,
0
),
font
=
font
)
return
image
return
image
...
...
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