Compile and convert text to brainfuck code
npm i bfcomp
CDN Links:
// ES6
import bfcomp from "bfcomp";
// commonjs
const bfcomp = require("bfcomp");
const code = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";
const text = bfcomp.compile(code);
const text2 = bfcomp.toText(code);
console.log(text); // "Hello World!"
console.log(text2); // "Hello World!"
// code variable declared in the previous example
bfcomp.run(code);
This will console.log()
the compiled BF code.
const code = bfcomp.toCode("Hello!");
console.log(code); // returns BF code
const code = bfcomp.toCode("Hello!");
bfcomp.run(code);