Class: Rbfunge::Base
- Inherits:
-
Object
- Object
- Rbfunge::Base
- Defined in:
- lib/rbfunge.rb
Overview
creates the interpreter and loads programs from files
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
initialize the class.
-
#load_file(file_path) ⇒ Object
load a file and interpret it currently, this is assuming Befunge-93 80x25 layout.
Constructor Details
#initialize ⇒ Base
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 |