Manufactoria has been marketed as a game, but we code-golfers can see it for what it really is: a two-dimensional programming language. The Manufactoria programming language is based around a single queue, which contains a series of colorful markers. The instruction pointer moves around the game board using conveyor belts, and it encounters a series of writers and branches which read from and write to the queue.
The language is very easy to understand, so the quickest way to learn it is to play the first few levels of the game (linked above).
Your challenge is to create a program that can divide one number by another number in the least amount of time.
The input to the program will be a string of X blue markers followed by Y red markers. The required output will be a string of red markers with a length of X/Y.
The game board to be used is found in this official contest level:
It is 13x13 (the maximum size) and it is pre-equipped with the correct tests (see the scoring section).
The score of your program is the total amount of time that it takes for the program to pass all of the tests in the official contest level. The total time is given on the level-complete screen.
While running the tests, you will most likely have to use the 50x accelerate slider in the bottom left in order to receive the results quickly (time acceleration does not affect the score).
Here is a list of division problems that are involved in the tests:
6/2 = 3 3/3 = 1 4/1 = 4 0/1 = 0 12/4 = 3 12/3 = 4 9/3 = 3 10/2 = 5
12/3=4 in: BBBBBBBBBBBBRRR out: RRRR 10/2=5 in: BBBBBBBBBBRR out: RRRRR 9/3=3 in: BBBBBBBBBRRR out: RRR 0/1=0 in: R out: