Module: Befunger

Defined in:
lib/befunger.rb,
lib/befunger/version.rb,
lib/befunger/interpreter.rb

Overview

Example usage:

code = ">987v>.v\nv456<  :\n>321 ^ _@\n"
output = Befunger.run(code)

Defined Under Namespace

Classes: Interpreter

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.run(code) ⇒ String

Runs befunge code and returns the output

Parameters:

  • code (String)

    the code to be run, lines separated with newline characters.

Returns:

  • (String)

    output of the program



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

def self.run(code)
  Befunger::Interpreter.new(code).run
end