67

Universal
Turing Machine
editor
terminal
instructions
Turing Machines
Turing Machines are hypothetical computers invented by Alan Turing. Turing Machines consist of a tape that extends infinitely at both ends and a "head" that can read and write to the tape. The Turing Machine performs a sequence of steps one at a time. Each step can perform one of the following four commands:- Read the character beneath the tape head
- Write a character to the tape
- Move the tape head one cell to the left
- Move the tape head one cell to the right
Instructions
The parts of the Turing Machine simulator (corresponding to the definition above) are shown below.is the head of our Turing Machine | |
C | is a character cell on the Turing Machine tape. Computers can only operate on numbers, so each character has an associated number. We use the ASCII character encoding system to convert characters to numbers. The character is shown in black and its associated number is shown in light red below the character. Some numbers have special meanings and therefore don't have an associated character, so they are represented as blanks. |
Brainfuck
Brainfuck is a programming language. Brainfuck programs are a sequence of commands performed in order.Brainfuck Commands
> | Move the tape head one space to the right |
< | Move the tape head one space to the left |
+ | Increment the character beneath the tape head |
- | Decrement the character beneath the tape head |
. | Print out the character beneath the tape head |
, | Prompt the user to enter a character and write it beneath the tape head |
[ | Read the character beneath the tape head; if the character is 0, then jump to the matching ] , otherwise run the commands between [ and ] . |
] | This command designates the end of a [ ... ] block. Like parenthesis in math, brackets in Brainfuck must be balanced and the outermost [ matches only with the outermost ] . |
Additional Commands
In addition to the Brainfuck commands, this Turing Machine simulator can also use the following commands; each command is a single character.A | The Turing Machine halts and accepts the string. |
R | The Turing Machine halts and rejects the string. |
H | The Turing Machine halts without accepting nor rejecting the string. |
# | This is the comment character. It allows you to add text to your Brainfuck code without having any affect on its operation. Everything from after the # until the end of the line is ignored by the Turing Machine |
Operating Speed: