class Noofakku::VM

Public Class Methods

start(program, input, output) click to toggle source
# File lib/noofakku.rb, line 14
def self.start(program, input, output)
    processor = Processor.new(Hash.new(Noop.new).merge!({
    '>' => Next.new,
    '<' => Prev.new,
    '+' => Inc.new,
    '-' => Dec.new,
    '.' => Output.new,
    ',' => Input.new,
    '[' => OpenBracket.new('[', ']'),
    ']' => ClosedBracket.new('[', ']')
  }))
  processor.run(program.clone.freeze, Array.new(30_000, 0), input, output)
end