Difference between revisions of "Activities/Turtle Art/Tutorials/Turtle Art Code for Turing Machine"

From Sugar Labs
Jump to navigation Jump to search
(Starting to lay out actions; seriously incomplete)
(Headings; images to come)
Line 3: Line 3:
 
In progress.
 
In progress.
  
* Start is the main procedure
+
* The Start action is the main procedure
  
* Setup defines and initializes variables, and sets the orientation of the turtle
+
* The Setup action defines and initializes variables, and sets the orientation of the turtle
  
* Tape writes the initial tape. User can change values in repeat statements to change arguments.
+
* The Tape action writes the initial tape. User can change values in repeat statements to change arguments.
  
* Program writes the program table
+
* The Program action followed by the stack1 action writes the program table line by line. This is divided in two so that the segments fit in the Turtle Art workspace
 +
 
 +
* The Execute action carries out the next program step until the halt state is reached
 +
 
 +
* The ToTape action Move turtle to current cell on tape
 +
 
 +
* The ToProgram action Move Turtle to beginning of current program row to execute
 +
 
 +
* The WriteCell action Write current color to current cell, and move to next cell
 +
 
 +
* The WriteSymbol action Write current color in cell without moving
 +
 
 +
* The ReadPixel action Read RGB values of pixel to stack, pop to variables
 +
 
 +
* The SetValue action Find value of cell symbol from RGB numbers
 +
 
 +
* The SetMove action Read next Move direction from program table
 +
 
 +
* The SetSymbol action Read next Symbol to write from program table
 +
 
 +
* The SetState action Read next State from program table
 +
 
 +
* The NewCell action Move left or right and set cell number of new location
 +
 
 +
* The Log action Write Step number, Symbol, Move, State, Cell number on new log line in black, saving and restoring

Revision as of 21:18, 29 June 2011

Turtle Art Code for Turtle Art Turing Machine

In progress.

  • The Start action is the main procedure
  • The Setup action defines and initializes variables, and sets the orientation of the turtle
  • The Tape action writes the initial tape. User can change values in repeat statements to change arguments.
  • The Program action followed by the stack1 action writes the program table line by line. This is divided in two so that the segments fit in the Turtle Art workspace
  • The Execute action carries out the next program step until the halt state is reached
  • The ToTape action Move turtle to current cell on tape
  • The ToProgram action Move Turtle to beginning of current program row to execute
  • The WriteCell action Write current color to current cell, and move to next cell
  • The WriteSymbol action Write current color in cell without moving
  • The ReadPixel action Read RGB values of pixel to stack, pop to variables
  • The SetValue action Find value of cell symbol from RGB numbers
  • The SetMove action Read next Move direction from program table
  • The SetSymbol action Read next Symbol to write from program table
  • The SetState action Read next State from program table
  • The NewCell action Move left or right and set cell number of new location
  • The Log action Write Step number, Symbol, Move, State, Cell number on new log line in black, saving and restoring