Fuzziqer Software [+] (open-plus-close)
=======================================

[+] (also known as OPC) is a Windows compiler and interpreter for the brainfuck
programming language. I'll be the first to admit that brainfuck is a fairly
simple language for a computer to understand, and hence, writing a
compiler/interpreter for it is not a difficult task compared to writing a
compiler for, say, C++.

So why write one? Well, there are a few reasons: I've never written any program
that generates EXE files "from scratch" (I've only worked on pre-existing EXEs),
and brainfuck is kind of a cool language too. It's a Turing tarpit, but not so
restrictive that it becomes absolutely uninteresting.

OPC can operate in two modes: compiler, or interpreter. You get more options
with the interpreter, but a compiled brainfuck program is much faster than an
interpreted one. If you run opc.exe with no arguments, you'll get a breakdown
of the options it supports. Here they are in a bit more detail:



In compiler mode, run it as:
opc [-s] [-a<size>] <infile> =<outfile>

The -s option disables optimization (OPC automatically detects sequences of
similar operations and merges them into one - for example, ++++++++ becomes
an "add 8" opcode when compiled, rather than 8 "add 1" opcodes).

The -a option changes the amount of memory available to the compiled program.
By default, brainfuck programs have 30000 bytes available to them, but you
can change that to whatever you want.

<infile> is the brainfuck script to be compiled (a .b file).

<outfile> is the resulting executable (.exe) file. (Note that the = before
<outfile> is not a mistake.)

Example:
opc -s helloworld.b =helloworld.exe
opc primes.b =primes.exe



In interpreter mode, run it as:
opc [-p] [-a<size>] [-w] <infile> [+<initfile>] [~<exitfile>]

The -p option shows the machine's state once the program has terminated. This
can be useful for debugging a brainfuck program.

The -a option works just like in compiler mode: it changes the amount of memory
available to the brainfuck program.

If you specify -w, OPC will wait when the BF program is done. ("Press any key to
continue...")

<infile> is the brainfuck script to be interpreted (a .b file).

Some brainfuck programs expect arguments; for example, an program that encrypts
a file will need that file as input. The contents of initfile, if provided, will
be loaded directly into the brainfuck program's memory before it begins.

And some programs return data. In order to capture the returned data, you can
specify <exitfile>, and OPC will save the contents of the program's memory
(from the beginning to the location of the machine's pointer) once it completes
execution.