Manufactoria

Manufactoria is based on the game, and is basically the same thing. It was made by Quincunx with permission from pleasingfungus.

Definition
Manufactoria is a two-dimensional ASCII-based programming language. Here is a quote from the game that might help with understanding this language:

We, INDUSTRIAL ROBOTICS, have contracted you, ROBOTICS ENGINEER, to help us with a problem. Our robots - built to bring happiness and joy to people across the world! - have shown an unfortunate tendency to go mad. Our investigators suggested TESTING our robots before shipping them... which is where you come in. Your job is to build: a testing MACHINE! Our robots are programmed with read and blue code-symbols. Each class of robot follows a pattern in its programming. If that pattern is matched, the robot behaves correctly. Otherwise... well! You will be given conveyor belts, which move robots in a fixed direction, and branch-conveyors, which read the next symbol and move the robot in the corresponding direction. With these tools, build a machine that moves robots: to the exit if they match the pattern given ('accept'), and to the floor with the rejects!

When the program is run, a robot with the input on its tape (queue) goes from the  in the rightwards direction.

Conveyors and bridges  are the basic building blocks to the program; they tell the robot to move in a certain direction.

Branches move the robot in the direction corresponding to the first value on the queue. A branch has two colors, say a and b. If the first color is a, then the robot moves in the direction of a. If the color is b, then it moves in the direction of b. Otherwise, it moves in the direction of n (neutral). If the robot moves in any direction other than n, the first color is removed. A branch that 'points' in a certain direction has its neutral value pointing in that direction. Following is the b/r branch : --- |b    r|  \__n__/ If a  is the first color, the robot will move left (as if it hit a  ) and the   is removed. If a  is the first color, the robot will move right (as if it hit a  ) and the   is removed. Otherwise, the robot moves down (as if it hit a ).

Writers add a new value onto the end of the queue.

Any mention of a number as binary works as follows:
 * Any  or   is ignored.
 * A  acts as a , and a   acts as a
 * The most significant bit is the bit closest to the head (first element) of the queue.

Instructions
Manufactoria has four directions for basically every command. SHIFT->CHAR (on Qwerty keyboard) reverses the direction of most commands in this language. * chosen because of similarity to the corresponding letter.

If the robot goes off the edge of the screen, it acts as if it hit a space.

Input
Input is taken as a command line argument. There are three options: input by sequence of colors, input by interpreting a number into binary ( is a   and   is a  ), and input by interpreting the input as ASCII (where 7 bits encode each character; compatible with   for output).

No matter which input is used, the robot starts by moving right. If the robot moves onto a starting character, the robot acts as if it moves onto a space.

There can only be one starting character in the program. If there are multiple, the compiler/interpreter throws an error.

When the input does not match the input type, it is implementation dependent on what happens.

Hello, World!
@brrbrrrbbrrbrbbbrbbrrbbrbbrrbbrbbbbrbrbbrrrbrrrrrbrbrbbbbbrbbbbbbbrrbrbbrbbrrbbrrbrrrbrrrrb$

Busy Beaver
CRR@v Crc >yyT ic<<vGO>v v#jbKRv >##>t<< cI.

Last color inputted
@v v>##; vvdcvv v#o##v v##o#v v>KK#II#< ^#j^ ^j#^ TQ >;

Implementations
https://github.com/Quincunx271/ManufactoriaLang