Turing-machine
A Turing machine with three working states, two symbols, and a tape printed when it stops.
User:A, 2018 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Turing-machine writes a Turing machine as a list of rules. Q1:E<0 says that in state Q, reading a 1, the machine writes 0, moves left and goes to state E. There are only three working states, Q, E and O, plus the final state F. That is very few. The specification notes that no known universal machine is this small, so whether it is Turing complete is open. The input is written on the tape before the run, and the tape is printed when the machine halts.
The machine
| Part | Means |
|---|---|
Q E O | Working states; Q is the start |
F | Final state; the machine halts |
0 1 | Symbols; the tape starts as 0 |
< > - | Move left, right, or stay |
The printed tape runs from the leftmost to the rightmost cell the head or the input reached.
Example
This is the 3-state busy beaver.
This is the 3-state busy beaver. It halts after 13 steps with six 1 bits on the tape, the most a machine of this size can leave.
Further
Ideas it shows
See also
Also in Turing tarpits
Write your own in Run Convert a program from Turing-machine
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: turing-machine.
Command line
shib run turing-machine -e 'Q1:E>1
Q0:O>0
E0:E>1
O0:F<0' --input '0'shib manual turing-machineSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/turing-machine.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org