Class: TuringMachine::Instruction
- Inherits:
-
Object
- Object
- TuringMachine::Instruction
- Defined in:
- lib/turing_machine/instruction.rb
Overview
Public: The instruction table of a Turing machine.
Instance Method Summary collapse
- #for(symbol, state) ⇒ Object
-
#initialize(table) ⇒ Instruction
constructor
A new instance of Instruction.
Constructor Details
#initialize(table) ⇒ Instruction
Returns a new instance of Instruction.
6 7 8 |
# File 'lib/turing_machine/instruction.rb', line 6 def initialize(table) @table = table end |
Instance Method Details
#for(symbol, state) ⇒ Object
10 11 12 |
# File 'lib/turing_machine/instruction.rb', line 10 def for(symbol, state) @table[[symbol, state]] end |