GitHub
All our OpenSource projects have been migrated to GitHub.
Feel free to fork!
Feel free to fork!
BrainDead is an interpreter for the BrainFuck programming language, written in C, that can be run in interactive or non-interactive mode.
Examples for the BrainDead interpreter
HelloWorld (commented version)
Example code
++++++++++ | Cell 0 is 10[ | Repeats till cell 0 is 0 >+ | Cell 1 is 1 (will be ASCII 10 = __LF__) >+++ | Cell 2 is 3 (will be ASCII 30 = __RS__) >+++++++ | Cell 3 is 7 (will be ASCII 70 = F) >++++++++ | Cell 4 is 8 (will be ASCII 80 = P) >++++++++++ | Cell 5 is 10 (will be ASCII 100 = d) >+++++++++++ | Cell 6 is 11 (will be ASCII 110 = n) <<<<<<- | Decrements cell 0] | End of loop$ | Prints the stack state (not a standard brainfuck command)@ | Breakpoint (not a standard brainfuck command)>>>++. | H>>+. | E+++++++. | L. | L>+. | O<<<<++. | __SPC__>>+++++++. | W>>. | O+++. | R<. | L--------. | D<<<+. | !<+++. | __CR__---. | __LF__>>. | H>>+. | E+++++++. | L. | L>---. | O<<<<-. | __SPC__>>--. | U>>-. | N<---. | I>++++++++. | V<----. | E>----. | R+. | S<. | E<<<+. | !<+++. | __CR__---. | __LF__$ | Prints the stack state (not a standard brainfuck command)% | Resets the stack (not a standard brainfuck command)$ | Prints the stack state (not a standard brainfuck command)
Example output
$ braindead -zbsm 10 helloworld.bf
--------------------------------------------------------------------------------[STACK DEBUG - START]--------------------------------------------------------------------------------Number of allocated cells: 10Number of used cells: 7Current cell index: 0--------------------------------------------------------------------------------Cell #0: 0Cell #1: 10Cell #2: 30Cell #3: 70Cell #4: 80Cell #5: 100Cell #6: 110Cell #7: 0Cell #8: 0Cell #9: 0--------------------------------------------------------------------------------[STACK DEBUG - END]--------------------------------------------------------------------------------[BREAKPOINT] - Press any key to continue...hello, worldHello Universe!--------------------------------------------------------------------------------[STACK DEBUG - START]--------------------------------------------------------------------------------Number of allocated cells: 10Number of used cells: 7Current cell index: 1--------------------------------------------------------------------------------Cell #0: 0Cell #1: 10Cell #2: 33Cell #3: 72Cell #4: 85Cell #5: 101Cell #6: 115Cell #7: 0Cell #8: 0Cell #9: 0--------------------------------------------------------------------------------[STACK DEBUG - END]----------------------------------------------------------------------------------------------------------------------------------------------------------------[STACK DEBUG - START]--------------------------------------------------------------------------------Number of allocated cells: 10Number of used cells: 7Current cell index: 1--------------------------------------------------------------------------------Cell #0: 0Cell #1: 0Cell #2: 0Cell #3: 0Cell #4: 0Cell #5: 0Cell #6: 0Cell #7: 0Cell #8: 0Cell #9: 0--------------------------------------------------------------------------------[STACK DEBUG - END]--------------------------------------------------------------------------------