Coffee Shop Puzzle

The coffee shop puzzle is a variation of a classic computer science problem. A local coffee shop sells coffee in 5 different cup sizes: Small, Medium, Large, Grande and Grande Supremo. For the puzzle, an empty cup of each size is flipped upside-down and they are stacked smallest-to-largest, one-inside-the-other like a set of Russian Matryoshka dolls. Three circles on a countertop indicate positions where a cup can be placed. The nested cups start out on the left circle.

Initial Puzzle State

Using the mouse, you can move one cup at a time from circle to circle. The goal is to move all 5 cups to the green circle on the right. However, larger cups can be placed over smaller cups, but not the other way around.

Intermediate Puzzle State

The application may take several seconds to launch as the graphics are rendered. Please be patient.


Hack up the source code here:

J4K 2009