Skip to content

Commit

Permalink
broken still
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSecondComing123 committed Mar 9, 2022
1 parent b3383c9 commit 6c0c504
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codepage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FUNCTIONS = ["+", "-", "×", "÷", "ⁱ", "g", "¶", "Đ", "!", "Ŋ"]
FUNCTIONS = ["+", "-", "×", "÷", "ⁱ", "g", "¶", "Đ", "!", "Ŋ", "Ƣ"]

INDICATORS = ["↹", "{", "}"]

Expand Down
4 changes: 4 additions & 0 deletions element_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ def intinput():

def repeat(a: str, b: int):
return a * b


def mod(a: int, b: int):
return a % b
3 changes: 2 additions & 1 deletion elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ def __call__(self, *args, **kwargs):
# g (and other constants) must be a lambda because the interpreter tries to call it
"¶": Element(arity=1, func=Print),
"Đ": Element(arity=1, func=SumDigits),
"Ŋ": Element(arity=0, func=IntInput)
"Ŋ": Element(arity=0, func=IntInput),
"Ƣ": Element(arity=2, func=Mod)
}
6 changes: 5 additions & 1 deletion functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
c = 10
d = 16
e = 256
f = 32768
f = -1
h = 65536
i = 2048
j = 4906
Expand Down Expand Up @@ -88,3 +88,7 @@ def SumDigits(a, ctx=None):

def IntInput(ctx=None):
return intinput()


def Mod(a, b, ctx=None):
return mod(a, b)
2 changes: 1 addition & 1 deletion unittests/general_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class MyTestCase(unittest.TestCase):
def test_basicops(self):
self.assertEqual(run("+1 1"), [2])
self.assertEqual(run("-1 1"), [0])
self.assertEqual(run("-2 1"), [1])


if __name__ == '__main__':
Expand Down

0 comments on commit 6c0c504

Please sign in to comment.