Skip to content

Instantly share code, notes, and snippets.

@romac
Created November 30, 2009 23:42
Show Gist options
  • Save romac/245885 to your computer and use it in GitHub Desktop.
Save romac/245885 to your computer and use it in GitHub Desktop.
PHP Turing Machine First Run Output
Input
=====
1:0:+1|1:1:+1|2:e:-1
3:e:-1|4:e:-1|0:e:-1
3:e:-1|3:e:-1|5:1:+1
4:e:-1|4:e:-1|5:1:+1
0:e:-1|0:e:-1|0:e:-1
Starting Turing Machine
=======================
Current state : 1
Tape : 10
Head : ^ ( 0 )
-----------------------------------------
read: 1, new state: 1, write: 1, move: 1
-----------------------------------------
Current state : 1
Tape : 10
Head : ^ ( 1 )
-----------------------------------------
read: 0, new state: 1, write: 0, move: 1
-----------------------------------------
Current state : 1
Tape : 10
Head : ^ ( 2 )
-----------------------------------------
read: e, new state: 2, write: e, move: -1
-----------------------------------------
Current state : 2
Tape : 10e
Head : ^ ( 1 )
-----------------------------------------
read: 0, new state: 3, write: e, move: -1
-----------------------------------------
Current state : 3
Tape : 1ee
Head : ^ ( 0 )
-----------------------------------------
read: 1, new state: 3, write: e, move: -1
-----------------------------------------
Current state : 3
Tape : eee
Head : ^ ( 0 )
-----------------------------------------
read: e, new state: 5, write: 1, move: 1
-----------------------------------------
Current state : 5
Tape : 1eee
Head : ^ ( 1 )
-----------------------------------------
read: e, new state: 0, write: e, move: -1
-----------------------------------------
1eee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment