im making a custom lambda calculus interpreter using python, but I can’t figure out how to actually run the lambda code
like it is in traditional lambda calculus
the current code is just my way of taking in input code from a developer
heres my current code:
line = 0
word = 1
variables = []
uses = []
w_ignore = 0
l_ignore = 0
print("Enter your code (press Enter twice to finish):")
while running:
ans = input() # Get user input
if ans == "": # Check for an empty line to break the loop
break
temp = ans.split(" ")
code.append(temp)
while running:
print(code)
print("Now that your code exists, would you like to:")
print("Type 'r' to run")
print("Type 'e' to edit")
print("Type 'f' to finish")
print("Warning: finishing will make the game run every time the code is opened.")
print("You can't edit anymore. I would recommend copying this file.")
ans = input()
if ans == "e":
print(code)
print("Type the number of the line you wish to edit")
line = int(input())
print("Do you wish to overwrite the line or just change one word?")
print("Type 'o' to overwrite, otherwise type the number of the word you wish to change")
ans = input()
if ans == "o":
print("Type the new code for the line here")
ans = input()
temp = ans.split(" ")
code[line] = temp
print(code)
else:
word = int(ans)
print("Type the word here")
ans = input()
code[line][word] = ans
elif ans == "r":
for line in range(len(code[1])):
if l_ignore <= 0:
for word in range(len(code[line][1])):
if w_ignore <= 0:
if code[line][word] == "#":
w_ignore = 2
w_ignore = w_ignore - 1
l_ignore = l_ignore - 1