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:
parent
58db3e7677
commit
2aeafe5483
1 changed files with 13 additions and 3 deletions
16
chainify.py
16
chainify.py
|
@ -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":
|
||||||
|
|
Loading…
Reference in a new issue