Manufactoria: A Tile-based Programming Game

What is a “tile-based programming game”? That’s a very good question. I never dreamt of such a thing until I played Manufactoria today. Be warned: if you’re not a programmer you will have great difficulty with this game.

A picture is worth a thousand lines of code, so I’ll show you a screenshot from the game. The following screenshot is an implementation of a bubble sort that operates on a queue of boolean variables.

A bubble sort implemented in Manufactoria

A bubble sort implemented in Manufactoria

It’s an absolutely crazy idea for a game, isn’t it? Let me give you a quick overview of it.

It is a little hard to explain how the game is played, so I recommend experiencing it for youself, but here’s a quick diagram illustrating parts of the game in terms programmers are used to:

Explanation of Manufactoria for Programmers

Explanation of Manufactoria for Programmers

The game requires that you either filter the argument based on it’s value, or transform the value of the argument, using only the rudimentary operations mentioned above. The screenshot above is a solution to the requirement: “The input, but all blues moved to the front!”. The jet plane begins at the top, gets bubble sorted by travelling around the grid, and eventually exits via the hole at the bottom.

Here’s another screenshot. The requirement that this screenshot solves is: “With blue as 1 and red as 0, add 1 to the binary string!”

Incrementing a Binary Value by One in Manufactoria

Incrementing a Binary Value by One in Manufactoria

This algorithm starts at the least significant bit (the end of the queue) and works it’s way back to the most significant bit, manipulating the bits as it goes along. It uses the yellow dot as a “carry” marker when the addition results in an overflow that needs to be carried up to the next significant bit. Iterating the queue from back to front using only push and pop operations is an exercise in horrendous pain, and I’ll leave you to discover how to do that by yourself.

Implementing loops in Manufactoria feels to me like tail recursion, but I wouldn’t liken it to any specific programming language. Although, in some ways, it’s like a visual version of a certain crassly named programming language. You are given a small set of rudimentary operations that make the control flow really difficult to comprehend.

Also, the branching is weird. A normal old if statement has two branches: a true branch and a false branch. In Manufactoria, there are three branches: a red/yellow branch, a blue/green branch, and a “neither” branch for when the queue is empty or neither of the colours was at the front of the queue.

It’s a turing tarpit indeed.

  • http://ajsands.com Ashley Sands

    Wow this is a pretty cool game. A bit confusing to learn though.

  • http://www.tri-statefloorservice.com/1910819109.tile-grout-cleaning-service.tile-repair.html Tile Repair Montgomery

    Wow! This is a nice game. I like it very much.

  • http://www.pridecarpetcleaning.com Grout Cleaning

    Thank you for another excellent post. Keep up the good work.

  • http://www.tri-statefloorservice.com Tile Repair

    Thanks for your offer. You have really written a nice blog.

  • http://www.tri-statefloorservice.com Grout Cleaning Montgomery

    I think this is one of the most vital information for me.