bfunj is a slightly altered Befunge-93 interpreter written in Ruby.

The official Befunge-93 specification can be found at catseye.tc/projects/befunge93/doc/website_befunge93.html

The differences between Befunge-93 and bfunj are listed below:

  • “ command is removed

  • , command is removed

  • ~ command is removed

  • g command is removed

  • p command is removed

How to use: b = BFunj.new() b.load_file ‘filename.bfunj’ b.run puts b.stack.inspect

Options that can be passed to #new:

:input_stream - Defines the input stream, must be a kind_of?(IO). Default is $stdin :output_stream - Defines the output stream, must be a kind_of?(IO). Default is $stdout :max_steps - The maximum number of steps to take before program is forced to halt. this prevents infinite loops if. Default is 0 (never force halt). :filename - Auto-loads the given filename. Default is empty and you must manually load a file with #load_file.