Plays a mobile game better than my friends.



Open in new tab

A couple years ago, a friend of mine found a mobile app by the name of “Water Sort” and we competed to see who could get through the levels faster. There are many apps with the same concept, but this is the specific one we used.

The game itself is simple. You have a series of tubes that can each hold 4 units of colored water. The level starts with the colors mixed around and your goal is to get each tube to be full of a single color. You must achieve this by only moving the top color from any one tube to another. All levels start with some number of extra empty tubes to help you.

For this program, the input is hardcoded at the top of the file. To follow the result, you would poor the top from the green tube to the red tube. Press Space to go to the next step or Shift+Space to go to the previous step.



Tags: helper optimization simple