Implementation of Optimizing Brainfuck to Javascript compiler in Javascript

Written by Tomi Panula-Ontto, date: 2012-12-23, after a good night sleep

http://en.wikipedia.org/wiki/Brainfuck

Brainfuck source Js Output

go back to original version

Note! Brainfuck applications (merry xmas & hello world) found from the internet. Thank you guys, whoever you are.

Implemented syntax:
CharacterMeaning
>Increment the pointer (to point to the next cell to the right).
<Decrement the pointer (to point to the next cell to the left).
+Increment (increase by one) the byte at the pointer.
-Decrement (decrease by one) the byte at the pointer.
.Output the value of the byte at the pointer.
,Accept one byte of input, storing its value in the byte at the pointer.
[Jump forward to the command after the corresponding ] if the byte at the pointer is zero.
]Jump back to the command after the corresponding [ if the byte at the pointer is nonzero.