Skip to content

brainfuck compiler to JavaScript code

Notifications You must be signed in to change notification settings

zeddash/brainfuck

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainfuck

Very simple Brainfuck compilator to JavaScript

npm install

Require bf

var bf = require('./brainfuck.js');

Configure compilator

bf.config({memorySize: 256, bits: 16});

Compile Brainfuck code

var compiled = bf.compile('++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.');

Run code with empty input

var buf = [];
compiled.run('', function (num, char) {
  buf.push(char);
});
console.log(buf.join(''));

Show compiled code

console.log(compiled + '');

About

brainfuck compiler to JavaScript code

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%