Class: TuringMachine::Instructions
- Inherits:
-
Object
- Object
- TuringMachine::Instructions
- Defined in:
- lib/turing_machine/instructions.rb
Overview
Public: The instruction table of a Turing machine.
Instance Method Summary collapse
- #get(symbol, state) ⇒ Object
-
#initialize(table) ⇒ Instructions
constructor
A new instance of Instructions.
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 |