This puzzle is the next in my series of Manufactoria challenges.
Manufactoria is a game / two-dimensional programming language. The player must create programs that will manipulate a queue to arrive at the desired output. It is easy to learn but hard to master, so it lends itself to creating a wide variety of challenges. If you don't know what I am talking about, I advise that you play the first few tutorial levels of the game.
Your challenge is to create a machine that will return the very last element of the input string. To make this even more challenging, the input string can be any combination of all four colors.
The official custom level to be used is found here:
This week's challenge is mostly focused on the idea of compression. I chose this challenge to require a huge mess of conveyor belts. The fact that all four colors appear in the input means that it is very hard to store information.
Although I did not attempt compression, my first working prototype had 114 parts and fit into the 13x13 space with almost no room to spare.
The goal of this challenge is to use a few parts as possible. The score is the number of parts placed, and the lowest score wins.
Although there are only 8 test cases, your creation should be able to theoretically function under any test case. The test cases provided are for debugging purposes.
in: byrgyrbyrrgry out: y in: ggryybrryr out: r in: #don't you love degenerate cases? out: in: gyrbrygbrygbyrb out: b