Opentopia Directory Encyclopedia Tools

Pbrain

Encyclopedia : P : PB : PBR : Pbrain



 

The pbrain programming language is an extension of the Brainfuck programming language that adds support for procedures. This is done with the addition of the instructions :, (, and ) to the existing Brainfuck instructions.

A procedure is delimited by the ( and ) instructions. It assigned a numeric identifier equal to the contents of the active cell at the time the ( is encountered. For example, the following pbrain program creates a procedure numbered "1" that will increment the active cell:

+(+>)

To call this procedure, the active cell is set to 1 and the procedure is called with the : instruction. Assuming the current cell is zero, the following will call the above procedure:

+:

Implementations

A C++ interpreter and a C# compiler for Microsoft .NET may be found at [http://www.parkscomputing.com/code/pbrain/]

A concise interpreter in C is available at [http://www.hevanet.com/cristofd/pbrain.c].

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.


Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: