Marbles is a game from Maemo (a Linux variant used by, among others, the Nokia 770). You play in a square grid. Each cell can have a marble (of one of some four or five colours) in it, or can be empty; cells can also contain walls or various other special things. The goal is to form a particular pattern of marbles. The game will accept this pattern wherever you can form it, but most puzzles are very limited in where it is possible to form the goal pattern. For example, the first puzzle has four marbles, two of each of two colours, in a small grid: * * * * * * * * * . A . . * . * * * * . . . . * * . . B . * B * * * * * . * . * - - - * . * . * - - - * . A . * - - - * * * * * The goal pattern is A B B A This one can be solved in 11 moves. If we call the marbles in the left half of the grid A1 and B1, and the others A2 and B2, then we can do: B1 u, r A1 r A2 l, u, r B2 d, l, u, l A2 l The goal pattern can also be placed one cell lower, though it takes more moves. There are some other things that can complicate levels. There are one-ways, cells with a background pattern of arrows in one direction; when a marble reaches one of these moving against the arrows, it stops before entering that square; when it reaches it from any other direction, it starts moving in the direction of the arrows. (If a marble changes direction due to a one-way square, it is counted as another move.) There are one-ways with bars on the sides, in which case coming at it from the sides treats it like a wall. There are teleporters. Teleporters are paired by colour; for any teleporter, there is always exactly one other teleporter of the same colour. A marble that enters a teleporter is teleported to the other teleporter of the same colour and keeps moving in the same direction (unless the other teleporter has a marble on it, in which case the teleporter acts like blank floor). There are breakable walls. When a marble hits a breakable wall, the marble stops, but the wall turns into blank floor. (Some breakable walls can take multiple hits to disappear.)