tmsim

A fast turing machine simulator with graphviz export functionality

git clone https://git.8pit.net/tmsim.git

 1start: q0;
 2accept: q5;
 3
 4# Remove one zero from left hand side of the operation.
 5# If at operation symbol: terminate.
 6q0 {
 7	0 > X => q1;
 8	P | P => q5;
 9}
10
11# Go to the right hand side of the operation.
12q1 {
13	0 > 0 => q1;
14	P > P => q2;
15}
16
17# Add a zero to the right hand side of the operation.
18q2 {
19	0 > 0 => q2;
20	$ < 0 => q3;
21}
22
23# Go to the left hand side of the operation.
24q3 {
25	0 < 0 => q3;
26	P < P => q4;
27}
28
29# Find the first non-X character.
30# If none: stay add operation symbol.
31q4 {
32	0 < 0 => q4;
33	X > X => q0;
34}
35
36# Cleanup, remove X and P characters.
37q5 {
38	X < $ => q5;
39	P < $ => q5;
40}