node-brainfuck

0.0.2 • Public • Published
@@@@@@@   @@@@@@@    @@@@@@   @@@  @@@  @@@  @@@@@@@@  @@@  @@@   @@@@@@@  @@@  @@@
@@@@@@@@  @@@@@@@@  @@@@@@@@  @@@  @@@@ @@@  @@@@@@@@  @@@  @@@  @@@@@@@@  @@@  @@@
@@!  @@@  @@!  @@@  @@!  @@@  @@!  @@!@!@@@  @@!       @@!  @@@  !@@       @@!  !@@
!@   @!@  !@!  @!@  !@!  @!@  !@!  !@!!@!@!  !@!       !@!  @!@  !@!       !@!  @!!
@!@!@!@   @!@!!@!   @!@!@!@!  !!@  @!@ !!@!  @!!!:!    @!@  !@!  !@!       @!@@!@!
!!!@!!!!  !!@!@!    !!!@!!!!  !!!  !@!  !!!  !!!!!:    !@!  !!!  !!!       !!@!!!
!!:  !!!  !!: :!!   !!:  !!!  !!:  !!:  !!!  !!:       !!:  !!!  :!!       !!: :!!
:!:  !:!  :!:  !:!  :!:  !:!  :!:  :!:  !:!  :!:       :!:  !:!  :!:       :!:  !:!
 :: ::::  ::   :::  ::   :::   ::   ::   ::   ::       ::::: ::   ::: :::   ::  :::
:: : ::    :   : :   :   : :  :    ::    :    :         : :  :    :: :: :   :   :::

Lightweight, aynchronous, robust, flexible, non-blocking, fleiba, brainfuck interpreter written in javascript. Inspired by txus

Contents

  • 1 Amazing Nodejs module. Take advantadge of the event loop with brainfuck.
  • 1 Splendid Binary. Brainfuck power on your command line.
  • 1 Awesome brainfuck client for your browser!
  • 1 Replica from the script above... compressed! Less than 400b! OMG!

Install

$ npm install node-brainfuck

Nodejs

var bf = require('node-brainfuck);
bf(stdout);

Binary

$ node-brainfuck hello_world.bf

Client

<script src='brainfuck-client-compressed.js' type='text/javascript'></script>
<script type='text/javascript'>
  (function () {
    var str = '';
    bf(",>++++++[<-------->-],[<+>-]<.", function(out) {
      if (out === undefined) {
        alert('program output => ' + str);
      } else {
        str += out;
      }
    });
  }());
</script>

TODO:

  • Needs testing
  • Some nested brackets don't work properly
  • Somehow expose nodejs stdin so it can be used with any stream reader. (for example, building a http brainfucked server)
  • Have some holidays

Readme

Keywords

none

Package Sidebar

Install

npm i node-brainfuck

Weekly Downloads

1

Version

0.0.2

License

none

Last publish

Collaborators

  • masylum