Class: Rbfunge::Base

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

Overview

creates the interpreter and loads programs from files

Instance Method Summary collapse

Constructor Details

#initializeBase

initialize the class



8
9
10
# File 'lib/rbfunge.rb', line 8

def initialize
	@interpreter = Interpreter.new
end

Instance Method Details

#load_file(file_path) ⇒ Object

load a file and interpret it currently, this is assuming Befunge-93 80x25 layout



14
15
16
17
# File 'lib/rbfunge.rb', line 14

def load_file(file_path)
	code = File.open(file_path) { |f| f.read }
	@interpreter.run(code)
end