1
0
Fork 0
mirror of https://github.com/Lyxal/Keta.git synced 2024-08-14 23:53:13 +00:00

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

View file

@ -1,4 +1,4 @@
dyads = "*+-/%@" dyads = "*+-/%@!&^:"
monads = list(map(chr, range(ord("A"), ord("Z") + 1))) monads = list(map(chr, range(ord("A"), ord("Z") + 1)))
nilads = "1234567890" nilads = "1234567890"
@ -16,7 +16,8 @@ for char in source:
exprs = [] exprs = []
expr = [] 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", "102", "110", "111", "112", "120", "121", "122",
"202", "210", "211", "212", "220", "221", "222"] "202", "210", "211", "212", "220", "221", "222"]
pattern = "" pattern = ""
@ -41,7 +42,16 @@ print(exprs)
for exp in exprs: for exp in exprs:
pattern, fns = exp 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] + ")") print(fns[1] + "(" + fns[0] + ", " + fns[2] + ")")
elif pattern == "021": elif pattern == "021":