Class: TuringMachine::Instruction

Inherits:
Object
  • Object
show all
Defined in:
lib/turing_machine/instruction.rb

Overview

Public: The instruction table of a Turing machine.

Instance Method Summary collapse

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