Embedded Brainfuck Canvas
Brainfuck is a turing-complete programming language and abstract machine which has only eight operators.
I’ve written a greasemonkey script which searches webpages for specially formatted brainfuck programs, and turns them into graphics by running a brainfuck interpreter and piping the output of the program to an HTML 5 canvas element.
Here is an example program:
And here is what it looks like when it runs:
I’ve also made a couple of modifications to the language, firstly the ability to enter hex numbers 0 to F, as well as using unicode braille symbols to enter numbers 0 to 255. Secondly, the eight operators can be written using unicode trigrams, to make the program look nicer. The following trigram/braille brainfuck program draws a smiley face: :
See the embedded brainfuck canvas page for full details on how to embed a brainfuck program into a webpage.
If you have installed the script, below here you should be able to see some running brainfuck machines! Otherwise, you’ll just see the code
☸⠐⠐☵☴☵☴☵☴☵☴☵☴☵☴☵ ⠑☵⠏☰☶☴☳☵☲☷☵☵☵⠎☶ ☴☴☴☴☳☵⣔☵⠎☶☴☳☵☲ ☷☴⠬☵☴☴☳☵☵☵☵☲☷ ⠑☵⠏☰☶☴☳☵☲☷☵☵ ☵☵⡄☶☵☱☳☴☲☷☳ ⠆☵☱☴☶☵☱☳☴☲ ☷☳⡘☵☱☴☶☵☱ ☳☴☲☷☳⠆☵☱ ☴☶☵☱☳☴☲ ☷☳⠉☵☱☴ ☶☵☱☳☴ ☲☷☴⠆ ☶☵☳ ☴☲ ☷