Project

bfrb

0.0
No commit activity in last 3 years
No release in over 3 years
bfrb is a brainfuck interpreter written in Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.2
>= 0
 Project Readme

bfrb¶ ↑

bfrb is a simple brainfuck interpreter written in Ruby.

It’s not the most robust code, but it does the job, and has handled all the example code I’ve managed to throw at it.

Usage¶ ↑

To install bfrb:

% gem install bfrb

Once bfrb is installed, you can use it to interpret your brainfuck code.

First, you can pass brainfuck code directly into it, using the -c parameter:

% bfrb -c ",[.,]"

Or, you can specify a file with the -f parameter:

% bfrb -f test.bf

You can also start an interactive interpreter by running bfrb without any parameters:

% bfrb

The list of options is viewable with the -h parameter:

% bfrb -h

Just in case you feel the need to use another language internally in a Ruby program, I guess you can:

require 'rubygems'
require 'bfrb'

bf = BfRb::Interpreter.new
bf.run ",[.,]"

History¶ ↑

  • 0.1.5 - Modified to use OptionParser for command line parameters, ‘help’ command to REPL

  • 0.1.4 - Added a little more documentation, efficiency fixes and Ctrl-X to exit a program

  • 0.1.3 - Unmatched brace checks

  • 0.1.2 - Added unit tests

  • 0.1.1 - Added REPL.

  • 0.1.0 - Initial release. Allows running code passed in or from a file.