Execute Brain****/C++: Difference between revisions
m
Fixed syntax highlighting.
m (Move incorrect message, change sentence to works with template, whitespace) |
m (Fixed syntax highlighting.) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1:
It may be fed BF instructions either through standard input (i.e. terminal keyboard input), or through a file named as the first command-line argument.
RCBF is intended for educational purposes only; There is no guarantee it won't lock up your computer. (Though Mike M thinks he's got that bug ironed out...) (We'll no it wasn't, but it should be now -- RdB)
{{works with|g++|4.1.3
plus the GNU C++ Standard Library
<
// Created by Mike Mol and Mike Neurohr, and under the same license as Rosetta Code.
// Repaired by Robert de Bath -- but Ghods is it slow!
// Test with this Hello World, it breaks BF interpreters
// >++++++++[<+++++++++>-]<.>>+>+>++>[-]+<[>[->+<<++++>]<<]>.+++++++..+++.>
// >+++++++.<<<[[-]<[-]>]<+++++++++++++++.>>.+++.------.--------.>>+.>++++.
#include <list>
Line 238 ⟶ 244:
int input(memptr_t &ptr)
{
return SUCCESS;
}
Line 344 ⟶ 345:
codeptr_t tmppos = code.end();
rec.open = --tmppos;
rec.close = rec.open;
// Because we always encounter forward jumps before back jumps,
Line 393 ⟶ 395:
// We never found a close branch
return BRANCH_NOT_FOUND;
}</
|