Important notice - 06 April 2013

All eosgarden activities have been closed forever, in order to focus on new projects.
The content of this website will stay as is, for archive purpose, but won't be updated anymore.
eosgarden software are still available for download, but are no longer maintained. Support is no longer available.
 
 

GitHub

All our OpenSource projects have been migrated to GitHub.
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: 10
Number of used cells: 7
Current cell index: 0
--------------------------------------------------------------------------------
Cell #0: 0
Cell #1: 10
Cell #2: 30
Cell #3: 70
Cell #4: 80
Cell #5: 100
Cell #6: 110
Cell #7: 0
Cell #8: 0
Cell #9: 0
--------------------------------------------------------------------------------
[STACK DEBUG - END]
--------------------------------------------------------------------------------
[BREAKPOINT] - Press any key to continue...
hello, world
Hello Universe!
--------------------------------------------------------------------------------
[STACK DEBUG - START]
--------------------------------------------------------------------------------
Number of allocated cells: 10
Number of used cells: 7
Current cell index: 1
--------------------------------------------------------------------------------
Cell #0: 0
Cell #1: 10
Cell #2: 33
Cell #3: 72
Cell #4: 85
Cell #5: 101
Cell #6: 115
Cell #7: 0
Cell #8: 0
Cell #9: 0
--------------------------------------------------------------------------------
[STACK DEBUG - END]
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
[STACK DEBUG - START]
--------------------------------------------------------------------------------
Number of allocated cells: 10
Number of used cells: 7
Current cell index: 1
--------------------------------------------------------------------------------
Cell #0: 0
Cell #1: 0
Cell #2: 0
Cell #3: 0
Cell #4: 0
Cell #5: 0
Cell #6: 0
Cell #7: 0
Cell #8: 0
Cell #9: 0
--------------------------------------------------------------------------------
[STACK DEBUG - END]
--------------------------------------------------------------------------------