You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
728 B
26 lines
728 B
13 years ago
|
Usage:
|
||
13 years ago
|
======
|
||
|
```C++
|
||
13 years ago
|
brainfuck("++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.");
|
||
13 years ago
|
```
|
||
|
The default arguments make it use `std::cout` and an empty string as input.
|
||
13 years ago
|
|
||
|
|
||
|
You can also use a string as input:
|
||
13 years ago
|
brainfuck(",[.,]", "input");
|
||
13 years ago
|
|
||
|
Or with a stream/container/iterator:
|
||
13 years ago
|
brainfuck(",[.,]", std::input_iterator<char>(std::cin));
|
||
13 years ago
|
|
||
|
|
||
|
You can specify the memory-units:
|
||
13 years ago
|
brainfuck<int>("...");
|
||
13 years ago
|
As long as the type has certain operators. The default output is comma-seperated, except for char.
|
||
|
|
||
|
|
||
|
You can specify an output-iterator:
|
||
13 years ago
|
brainfuck("...", "", std::back_inserter(my_vector));
|
||
13 years ago
|
|
||
13 years ago
|
|
||
|
It has a lot of defaultparameters, because it's intended use was on an irc-channel.
|