Closed Espeer5 closed 1 year ago
We need a function which will convert any decimal number to an array of Tris the length of a word. This will need to do a few things:
WORD_SIZE
new Tri()
setState
The Tri object and methods are in tri.js The WORD_SIZE is found in constants.js
Note that balanced ternary means every digit can be either 0, 1, or -1. So for example (base 10 to balanced ternary):
Said function should be defined within conversions.js
We need a function which will convert any decimal number to an array of Tris the length of a word. This will need to do a few things:
WORD_SIZE
balanced TrisWORD_SIZE
new Tri()
objects andsetState
for each of them to the necessary value for the digitThe Tri object and methods are in tri.js The
WORD_SIZE
is found in constants.jsNote that balanced ternary means every digit can be either 0, 1, or -1. So for example (base 10 to balanced ternary):