forked from ThomasTheSpaceFox/libbaltcalc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest5.py
33 lines (20 loc) · 1002 Bytes
/
test5.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import libbaltcalc as btcalc
from libbaltcalc import btint
def test_tritchop(trit_string, splitpoint):
print("-----------TEST TRITCHOP-------------")
print("Input : " + trit_string + " , Split Point: " + str(splitpoint))
trits=btcalc.tritchop(btcalc.BTTODEC(trit_string), splitpoint)
print("First Part : " + btcalc.DECTOBT(trits[0]))
print("Second Part: " + btcalc.DECTOBT(trits[1]))
def test_tritmerge(upperint_string, lowerint_string, lower_length):
print("-----------TEST TRITMERGE-------------")
print("Input Upper: " + upperint_string)
print("Input Lower: " + lowerint_string + " , lower length: " + str(lower_length))
print("Output: " + btcalc.DECTOBT(btcalc.tritmerge(btcalc.BTTODEC(upperint_string), btcalc.BTTODEC(lowerint_string), lower_length)))
test_tritchop("---+++---", 3)
test_tritchop("---+++---", 6)
test_tritchop("---+++---", 9)
test_tritchop("---+++---", 12)
test_tritmerge("++-", "0", 1)
test_tritmerge("---+++---", "+++---+++", 9)