BrainLove
Ruby implementation of brainfuck.
Installation
Install it as:
$ gem install brain_love
Usage
Standalone
# Hello World
brain_love -e '>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]<.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.'
Or from file:
brain_love some_file.bf
In your code
require 'brain_love'
# Hello World
BrainLove.run_string('>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]<.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.')
Portability
- Data space contains 30 000 cells
- Data cell is unsigned byte (wraps around)
- EOF sets data cell to 0
- Nested loops
Current limitations
- jump offsets are 1 byte
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Copyright (c) 2012 Мар'ян Крекотень (Marjan Krekoten'). Distributed under the MIT License. See LICENSE for further details.