From 2aeafe5483e0724f6e34bf6417be2abec204ad90 Mon Sep 17 00:00:00 2001 From: JonoCode9374 <36217120+JonoCode9374@users.noreply.github.com> Date: Fri, 27 Dec 2019 08:15:23 +1100 Subject: [PATCH] Update chainify.py --- chainify.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/chainify.py b/chainify.py index 4c9723c..77e3540 100644 --- a/chainify.py +++ b/chainify.py @@ -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":