Update chainify.py

This commit is contained in:
JonoCode9374 2019-12-27 08:15:23 +11:00 committed by GitHub
parent 58db3e7677
commit 2aeafe5483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
dyads = "*+-/%@"
dyads = "*+-/%@!&^:"
monads = list(map(chr, range(ord("A"), ord("Z") + 1)))
nilads = "1234567890"
@ -16,7 +16,8 @@ for char in source:
exprs = []
expr = []
patterns = ["020", "021", "022", "02", "10", "11", "12", "20", "21", "22",
patterns = ["0", "1", "2",
"020", "021", "022", "02", "10", "11", "12", "20", "21", "22",
"102", "110", "111", "112", "120", "121", "122",
"202", "210", "211", "212", "220", "221", "222"]
pattern = ""
@ -41,7 +42,16 @@ print(exprs)
for exp in exprs:
pattern, fns = exp
if pattern == "020":
if pattern == "0":
print(fns[0])
elif pattern == "1":
print(fns[0] + "(R)")
elif pattern == "2":
print(fns[0] + "(L, R)")
elif pattern == "020":
print(fns[1] + "(" + fns[0] + ", " + fns[2] + ")")
elif pattern == "021":