Module: Esolang

Defined in:
lib/esolang.rb,
lib/refinements/refinements.rb,
lib/interpreters/ook_interpreter.rb,
lib/interpreters/base_interpreter.rb,
lib/interpreters/boolfuck_interpreter.rb,
lib/interpreters/brainfuck_interpreter.rb,
lib/interpreters/paintfuck_interpreter.rb,
lib/interpreters/smallfuck_interpreter.rb

Overview

“‘ruby using Esolang::Refinements “`

Defined Under Namespace

Modules: Interpreters, Refinements

Class Method Summary collapse

Class Method Details

.boolfuck(code, input = '') ⇒ String

Interprets Boolfuck code.

Parameters:

  • code (String)

    The Boolfuck code to interpret.

  • input (String) (defaults to: '')

    The input for the Boolfuck program (optional).

Returns:

  • (String)

    The result of the Boolfuck interpretation.



24
25
26
# File 'lib/esolang.rb', line 24

def self.boolfuck(code, input = '')
  Interpreters::Boolfuck.new(code, input).run
end

.brainfuck(code, input = '') ⇒ String

Interprets Brainfuck code.

Parameters:

  • code (String)

    The Brainfuck code to interpret.

  • input (String) (defaults to: '')

    The input for the Brainfuck program (optional).

Returns:

  • (String)

    The result of the Brainfuck interpretation.



53
54
55
# File 'lib/esolang.rb', line 53

def self.brainfuck(code, input = '')
  Interpreters::Brainfuck.new(code, input).run
end

.ook(code, input = '') ⇒ String

Interprets Ook! code.

Parameters:

  • code (String)

    The Ook! code to interpret.

  • input (String) (defaults to: '')

    The input for the Ook! program (optional).

Returns:

  • (String)

    The result of the Ook! interpretation.



62
63
64
# File 'lib/esolang.rb', line 62

def self.ook(code, input = '')
  Interpreters::Ook.new(code, input).run
end

.paintfuck(code, iterations, width, height) ⇒ String

Interprets Paintfuck code.

Parameters:

  • code (String)

    The Paintfuck code to interpret.

  • iterations (Integer)

    The number of iterations for the Paintfuck program.

  • width (Integer)

    The width of the Paintfuck canvas.

  • height (Integer)

    The height of the Paintfuck canvas.

Returns:

  • (String)

    The result of the Paintfuck interpretation.



44
45
46
# File 'lib/esolang.rb', line 44

def self.paintfuck(code, iterations, width, height)
  Interpreters::Paintfuck.new(code, iterations, width, height).run
end

.smallfuck(code, tape) ⇒ String

Interprets Smallfuck code.

Parameters:

  • code (String)

    The Smallfuck code to interpret.

  • tape (String)

    The initial tape state for the Smallfuck program.

Returns:

  • (String)

    The result of the Smallfuck interpretation.



33
34
35
# File 'lib/esolang.rb', line 33

def self.smallfuck(code, tape)
  Interpreters::Smallfuck.new(code, tape).run
end