Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 49 lines (30 sloc) 1.289 kb
189f6ff Josep M. Bach first commit
authored
1 # brainfuck
2
282eaf1 Josep M. Bach Brainfuck 0.2.0
authored
3 An implementation of Brainfuck on the [Rubinius](http://rubini.us) VM.
4
189f6ff Josep M. Bach first commit
authored
5 (If you don't know what Brainfuck is, you definitely
55a7a84 Josep M. Bach Learned Markdown.
authored
6 [should](http://en.wikipedia.org/wiki/Brainfuck)).
189f6ff Josep M. Bach first commit
authored
7
282eaf1 Josep M. Bach Brainfuck 0.2.0
authored
8 Obviously... needs Rubinius!
189f6ff Josep M. Bach first commit
authored
9
10 ## Installation and usage
11
1ae5016 Josep M. Bach 0.1.0 - Complete rewrite using parslet
authored
12 You just `gem install brainfuck` (or `gem 'brainfuck'` in your Gemfile)!
189f6ff Josep M. Bach first commit
authored
13
282eaf1 Josep M. Bach Brainfuck 0.2.0
authored
14 And then:
15
16 $ brainfuck my_file.bf
17
18 Or if you just want to generate the compiled bytecode in `my_file.bfc`:
19
20 $ brainfuck -C my_file.bf
189f6ff Josep M. Bach first commit
authored
21
22 You can also require the gem and use inline brainfuck in your ruby scripts like this:
23
24 require 'brainfuck'
25
282eaf1 Josep M. Bach Brainfuck 0.2.0
authored
26 # Brainfuck needs an object binding to do its stuff.
27 bnd = Object.new
28 def bnd.get; binding; end
29 bnd = bnd.get
30
31 Brainfuck::CodeLoader.execute_code "+++>+++<---", bnd, nil
189f6ff Josep M. Bach first commit
authored
32 # => [0, 3]
33
34 ## Note on Patches/Pull Requests
35
36 * Fork the project.
37 * Make your feature addition or bug fix.
38 * Add specs for it. This is important so I don't break it in a
39 future version unintentionally.
40 * Commit, do not mess with rakefile, version, or history.
41 If you want to have your own version, that is fine but bump version
42 in a commit by itself I can ignore when I pull.
43 * Send me a pull request. Bonus points for topic branches.
44
45 ## Copyright
46
1ae5016 Josep M. Bach 0.1.0 - Complete rewrite using parslet
authored
47 Copyright (c) 2011 Josep M. Bach. See LICENSE for details.
6bb3df4 Josep M. Bach This commit intentionally left blank
authored
48
Something went wrong with that request. Please try again.