Class: TuringMachine::Instructions

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

Overview

Public: The instruction table of a Turing machine.

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ Instructions

Returns a new instance of Instructions.



6
7
8
# File 'lib/turing_machine/instructions.rb', line 6

def initialize(table)
  @table = table
end

Instance Method Details

#get(symbol, state) ⇒ Object



10
11
12
# File 'lib/turing_machine/instructions.rb', line 10

def get(symbol, state)
  @table[[symbol, state]]
end