Turing.Instruction

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

Constructors

Instruction

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

Properties

FieldIn

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

FieldOut

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

HorizontalMovement

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

IsFieldModifier

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

IsFieldWildcard

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

IsStateModifier

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

IsStateWildcard

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

IsTerminal

#
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.
public bool IsTerminal { get; }

StateIn

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

StateOut

#
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.
public string StateOut { get; }

VerticalMovement

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

Methods

CreateTerminalInstruction

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

MatchesField

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

MatchesState

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

Parse

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

ToString

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

TryParse

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

Convertors

OperationResultDescription
implicitstringTuring.InstructionConvert a valid description into an instruction.