@post-machine-js/machine

A convenient Turing machine

Usage no npm install needed!

<script type="module">
  import postMachineJsMachine from 'https://cdn.skypack.dev/@post-machine-js/machine';
</script>

README

@post-machine-js/machine

Build Status npm (scoped)

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. An Alphabet class instance implemented in @turing-machine-js/machine library.
  • blankSymbol - the blank symbol, (space)
  • markSymbol - the mark symbol, *

Commands

The following commands are exported from the library.

Common commands

  • check(ix1,ix0) - if current tape section marked go to ix1th instruction or go to ix0th instruction otherwise
  • erase/erase(ix) - put the blank symbol into current tape section and go to the next/ixth instruction
  • left/left(ix) - move the carriage to the left and go to the next/ixth instruction
  • mark/mark(ix) - put the mark symbol into current tape section and go to the next/ixth instruction
  • right/right(ix) - move the carriage to the right and go to the next/ixth instruction
  • stop - stop the machine

Additional commands

  • call(subroutineName)/call(subroutineName,ix) - execute a subroutine by subroutineName name and go to the next/ixth instruction
  • noop/noop(ix) - do nothing and go to the next/ixth instruction

Links