Archived
1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
it-works/brainfuck
Joshua Moerman (@Kassalade) 47557ea5f6 docs
2011-05-22 17:41:27 +02:00
..
brainfuck.hpp brainfucklib, made with irc-use (geordi-irc) in mind 2011-05-22 17:25:44 +02:00
main.cpp brainfucklib, made with irc-use (geordi-irc) in mind 2011-05-22 17:25:44 +02:00
README docs 2011-05-22 17:41:27 +02:00

Usage:

brainfuck("++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.");
The default arguments make it use std::cout and an empty string as input.


You can also use a string as input:
brainfuck(",[.,]", "input");

Or with a stream/container/iterator:
brainfuck(",[.,]", std::input_iterator<char>(std::cin));


You can specify the memory-units:
brainfuck<int>("...");
As long as the type has certain operators. The default output is comma-seperated, except for char.


You can specify an output-iterator:
brainfuck("...", "", std::back_inserter(my_vector));


It has a lot of defaultparameters, because it's intended use was on an irc-channel.