Ball sort and water sort solver

Stuck on a ball sort or water sort puzzle from any game? Copy it into the vials below and the solver finds the shortest solution it can, then walks you through it one move at a time. Solutions are given as single-orb moves; a water sort player pours the same colours in the same order. It runs in your browser and is free.

1. Pick a colour. 2. Tap a vial to drop an orb of that colour on top. 3. Fill each vial from the bottom up, and leave the empty ones empty.

How do I use the solver?

  1. Set the number of vials to match your puzzle, counting the empty ones.
  2. Copy each vial from the bottom up. Pick a colour, then tap the vial to add an orb. The minus button under a vial takes its top orb back off.
  3. Press "Solve this board". The solver first checks the board makes sense, and tells you in plain words if a colour has too many or too few orbs.
  4. Step through the answer. The orb to move is lifted and the vial it goes to is lit. "Next move" makes the move for you.

The colours don't need to match your game exactly, as long as each colour in your game gets its own colour here. You can also enter a board part-way through, exactly as it stands.

Does it work for water sort puzzles?

Yes. A board that can be sorted as a ball sort puzzle can be sorted as a water sort puzzle, and the other way round. Enter each unit of water as one orb of that colour. The solver gives its answer as single-orb moves, and a water sort player pours the same colours in the same order: when several steps in a row take the same colour from one vial to another, that is one pour.

A pour in water sort moves every touching unit of a colour at once. If your game pours more than the next step asks for and the positions stop matching, enter the board as it now stands and solve again. Ball sort vs water sort explains the difference between the two.

Is the solution the shortest one?

For most boards, yes. The solver first runs an exact search, and when that finishes it says "No solution is shorter": that is the fewest single-orb moves possible. A very large board can be too big for the exact search. Then the solver uses faster searches and shows the shortest solution it found, and says that a shorter one may exist.

What if the board can't be solved?

The solver says so plainly. "Cannot be solved" means it tried every possible move and none leads to a sorted board. "Too big to finish searching" means it ran out of room before it found an answer, so it can't tell you either way. Orb Alchemy's own boards are all checked to be solvable, but boards from other games, or positions part-way through, sometimes are not.

Questions

Does the solver work for water sort puzzles?

Yes. Enter each unit of water as one orb of that colour. The solution is given as single-orb moves, and a water sort player pours the same colours in the same order. When your game pours several units at once, that covers the next few steps together.

Is the answer really the shortest?

When the solver says "No solution is shorter", it has searched every shorter line of play and that is the fewest single-orb moves possible. On very large boards it reports the shortest solution it found and says that a shorter one may exist.

Why does it say my board cannot be solved?

Because it tried every possible move and none leads to a sorted board. Most often a vial was copied in the wrong order or an empty vial is missing. If your game offers an extra tube, add it as an empty vial and solve again.

Is my board sent anywhere?

No. The solving happens in your browser. Your board is saved on your device so it is still there if you come back.