1.0.0 • Published 3 years ago
@turing-machine-js/library-binary-numbers v1.0.0
@turing-machine-js/library-binary-numbers
A library for the turing-machine-js.
Install
Using npm:
npm install @turing-machine-js/library-binary-numbers
or using yarn:
yarn add @turing-machine-js/library-binary-numbers
A concept
Binary numbers are represented as a sequence of symbols 0
and 1
.
A representation of a number starts with symbol ^
and ends with symbol $
.
For example:
^$
stands for 0^1$
stands for 1^10$
stands for 2^11$
stands for 3- etc.
There is no ability to work with negative numbers at this time.
This library provides following objects to work with binary numbers:
getTapeBlock
- this function returns aTapeBlock
class instance. It has only one tape. An alphabet of the tape contains the following symbols:space
as a blank symbol,^
,$
,0
and1
.states
- followingStates
class instances which represent some algorithms:goToNumber
- move the head to the number's endgoToNextNumber
- move the head to the next number (to the right)goToPreviousNumber
- move the head to the previous number (to the left)deleteNumber
- delete the current numbergoToNumbersStart
- move the head to the number's startinvertNumber
- change every symbol in the number to it's opposite one (0
to1
and1
to0
)normalizeNumber
- delete leading zerosplusOne
- add 1 to the numberminusOne
- subtract 1 from the number
If you want to use states which were described earlier, you must use a tape block received from the getTapeBlock
function.
Links
- The information about
TapeBlock
andState
classes is here - Turing Machine on the Wikipedia
1.0.0
3 years ago
0.2.9-alpha.1
4 years ago
0.2.9-alpha.2
4 years ago
0.3.0-alpha.4
4 years ago
0.2.9-alpha.0
4 years ago
0.3.0-alpha.3
4 years ago
0.3.0-alpha.2
4 years ago
0.2.8
4 years ago
0.3.0-alpha.1
5 years ago
0.3.0-alpha.0
5 years ago
0.2.7
5 years ago
0.2.6
5 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago