Update chainify.py

This commit is contained in:
JonoCode9374 2019-12-26 21:00:09 +11:00 committed by GitHub
parent 15a2665023
commit 147c611fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -22,7 +22,7 @@ patterns = ["020", "021", "022", "02", "10", "11", "12", "20", "21", "22",
pattern = ""
while len(arities):
if pattern in patterns and pattern + str(arities[-1][0]) not in patterns:
exprs += [pattern, expr]
exprs.append([pattern, expr])
expr = []
pattern = ""
@ -31,8 +31,15 @@ while len(arities):
arities.pop()
if expr and pattern in patterns:
exprs += [pattern, expr]
exprs.append([pattern, expr])
expr = []
pattern = ""
print(exprs)
for exp in exprs:
pattern, fns = exp
if pattern == "020":
print(fns[1] + "(" + fns[0] + ",", fns[2] + ")")