Turing.Instruction

References
public sealed class Turing.Instruction
Represents a single instruction in a two-dimensional Turing machine.

Constructors

Instruction

#
public Instruction(string stateIn, string stateOut, string fieldIn, string fieldOut, int horizontal, int vertical)
Create a new turing instruction.
stateIn (string)
stateOut (string)
fieldIn (string)
fieldOut (string)
horizontal (int)
vertical (int)

Properties

FieldIn

#
public string FieldIn { get; }
Gets the filter string for field content. This may be a straight up name, or a wildcard expression.

FieldOut

#
public string FieldOut { get; }
Gets the name to assign to the cell. If null, it indicates the cell content is to be left unmolested.

HorizontalMovement

#
public int HorizontalMovement { get; }
Gets the horizontal movement of the caret upon completion of this instruction.

IsFieldModifier

#
public bool IsFieldModifier { get; }
Gets whether this instruction changes the value of the field.

IsFieldWildcard

#
public bool IsFieldWildcard { get; }
Gets whether the field filter has wildcards.

IsStateModifier

#
public bool IsStateModifier { get; }
Gets whether this instruction changes the value of the state.

IsStateWildcard

#
public bool IsStateWildcard { get; }
Gets whether the state filter has wildcards.

IsTerminal

#
public bool IsTerminal { get; }
Gets whether this instruction represents the final one, after which there will be no more changes to the sheet. A terminal instruction has zero movement and leaves both the state and the current field intact.

StateIn

#
public string StateIn { get; }
Gets the filter string for states. This can be a straight up name, or a wildcard expression.

StateOut

#
public string StateOut { get; }
Gets the name of the state the machine is left in after this instruction completes. If null, it indicates the state is to be left unmolested.

VerticalMovement

#
public int VerticalMovement { get; }
Gets the vertical movement of the caret upon completion of this instruction.

Methods

CreateTerminalInstruction

#
public static Turing.Instruction CreateTerminalInstruction(string state, string field)
Create a terminating instruction.
state (string)State name filter.
field (string)Field content filter.
A terminating instruction for the specific field and state pair.

MatchesField

#
public bool MatchesField(string field)
Gets whether this instruction matches the given field.
field (string)Field to match.
True if the field is covered by this instruction.

MatchesState

#
public bool MatchesState(string state)
Gets whether this instruction matches the given state.
state (string)State to match.
True if the state is covered by this instruction.

Parse

#
public static Turing.Instruction Parse(string description)
Try to parse a turing instruction from a descriptive string.
description (string)

ToString

#
public override string ToString()
Create a string representation of this instruction.
Object.ToString

TryParse

#
public static bool TryParse(string description, out Instruction instruction)
Try to parse a turing instruction from a descriptive string.
description (string)
instruction (out Turing.Instruction)

Convertors

OperationResultDescription
implicitstringTuring.InstructionConvert a valid description into an instruction.