@post-machine-js/machine
v1.0.0
Published
A convenient Turing machine
Downloads
3
Readme
@post-machine-js/machine
Some basic objects to build your own post machine
Install
Using npm:
npm install @post-machine-js/machine
or using yarn:
yarn add @post-machine-js/machine
Classes
The following classes are exported from the library.
PostMachine
Tape
This class is reexported from the @turing-machine-js/machine
library.
Constants
The following constants are exported from the library.
alphabet
- the alphabet for the machine tapes. AnAlphabet
class instance implemented in@turing-machine-js/machine
library.blankSymbol
- the blank symbol,markSymbol
- the mark symbol,*
Commands
The following commands are exported from the library.
Common commands
check(ix1,ix0)
- if current tape section marked go toix1
th instruction or go toix0
th instruction otherwiseerase
/erase(ix)
- put the blank symbol into current tape section and go to thenext
/ix
th instructionleft
/left(ix)
- move the carriage to the left and go to thenext
/ix
th instructionmark
/mark(ix)
- put the mark symbol into current tape section and go to thenext
/ix
th instructionright
/right(ix)
- move the carriage to the right and go to thenext
/ix
th instructionstop
- stop the machine
Additional commands
call(subroutineName)
/call(subroutineName,ix)
- execute a subroutine bysubroutineName
name and go to thenext
/ix
th instructionnoop
/noop(ix)
- do nothing and go to thenext
/ix
th instruction
Links
- Post–Turing machine on the Wikipedia