Meta-Manufactoria
Manufactoria is a pretty great programming game. However, instead of writing machines to solve the problems, your goal is to write a program that creates the machines for you. If you are already familiar with Manufactoria, then for the next section, you only need to read the italicized phrases.
The Rules of Manufactoria
In this version of Manufactoria, you are placed in a 9x9 world. The input generator is in the center top square (4, 0)
, and the output acceptor is in the center bottom square (4, 8)
. When input is generated, it moves immediately down.
Input is represented by a robot that has a queue of colors. Output will be the same robot, but the queue may contain a different sequence of colors. Robots must always eventually end up in the output square. There are 2 colors available, Red and Blue.
Each tick, the robot moves 1 square. The direction the robot moves, and any modifications to the queue is determined by the square it is on. There are 3 types of squares:
Movement square. This square either moves the robot North, East, South, or West and does not affect the queue. You cannot have two movement squares on the same tile
Choice square. This square moves the robot based on the top color in the queue. The general Choice square moves the robot east if red, west if blue, south if empty, and never north. This square can be rotated or reflected to change the directions traveled.
Writer square. This square writes a color to the back of the queue, and moves the robot in a given direction.
STDIO and Scoring
Your program will be passed two lists of the same length, one containing the inputs, and the other containing the outputs. Each item of each list contains only the R
and B
characters, representing the input queue.
Your output is the board that solves the Manufactoria puzzle. Each square is represented by two characters. The first character represents the square type, the second represents the direction. The square types can be:
M
ovement
C
hoice
R
ed writer
B
lue writer.
..
Empty square
II
Input
OO
Output
The directions are:
- N
orth
- E
ast
- S
outh
- W
est.
The direction listed for a choice tile represents the direction traveled if the queue is empty. If the direction is lowercase, the tile is reflected (which swaps the colors).
The program which solves more puzzles than any other program wins. In the event of a tie, the tiebreaker is the program that produces the most efficient solutions. Efficiency is measured by the number of times the robot moves across all of the solutions.
Your program should be a general solver. I may add puzzles to the ones listed below at any time.
Sample Puzzles
The solutions given below don't necessarily have to do what the title indicates. Your program's solution also doesn't have to match the ones listed below. It only needs to solve the inputs given. The format below is
[Inputs] [Outputs]
Solution Map
Example 1: Don't do anything
["","R","B","RRBR","BRRBRB"] ["","R","B","RRBR","BRRBRB"]
........II........
........MS........
........MS........
........MS........
........MS........
........MS........
........MS........
........MS........
........OO........

Example 2: Print second R
and anything after:
["","R","B","RR","BRB","RBRBBB"] ["","","","R","","RBBB"]
........II........
..MSCSMWCSMW......
..RSMEMEMS........
BECsMEMEMS........
........MS........
........MS........
........MS........
........MS........
........OO........

Example 3: Reverse String (This doesn't reverse any string, it only works for the examples listed)
["","BBR","B","RRB","BRRRB","BBRB"] ["","RBB","B","BRR","BRRRB","BRBB"]
........IICsMERS..
......CECSCEMSBS..
......RSMSCEMSMW..
......REMSCEMS....
........MSRSMS....
........MSRSMS....
........MSRSMS....
........MSBWMW....
........OO........

Example 4: Only include Rs
["R","","BBR","BRR","B","RBRBRBBR","BBBBBBRRR","RBBBRBRBBB","RRRR"] ["R","","R","RR","","RRRR","RRR","RRR","RRRR"]
........II........
........MEMEMEMS..
MSCSMWCSMWCSMWCSMW
REREMERERSMW..MS..
........MSMWMWMW..
........MS........
........MS........
........MS........
........OO........
