Skip to content
Snippets Groups Projects
Commit a5a0974b authored by Antonio MATTAR's avatar Antonio MATTAR
Browse files

-Fixed the counter error

parent 6b62d7b8
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment