This is a solver for the Hanayama Cast Duet puzzle.
Select the start and target position, then push Solve to get the corresponding move sequence.
See full explanation.
Positions follow a simple convention and there are buttons for automatically setting a few predefined positions to be used as examples.
Here's a full explanation on how to setup any puzzle position.
First, place the puzzle with the "DUET" sign up, and the round corner in the bottom right.
The puzzle forms a 3x3 grid.
Each cell in the grid is assigned a coordinate of the form (column,row) where cell (1,1) is the bottom left cell, just above the "D" of "DUET",
and cell (3,1) is the round corner in the bottom right. The center cell is (2,2), the top right cell is (3,3).
The grid actually extends beyond the puzzle frame, because at least part of the ring can be there too.
So, it's possible to have coordinates like (1,0) for the "virtual" cell below the "D" of "DUET", and (4,1) for the cell just to the right of the round corner.
Because the puzzle frame is fixed, a position is described by the position of a half-ring and encoded as follow:
- the letter "U" if the peg is in the upper part of the ring, otherwise the letter "D";
- the coordinates of the cell that contains the peg (the part of the ring with the gap);
- the coordinates of the cell that contains the solid part of the ring.
The special notation "FREE" means that a half-ring is out of the frame.
This may look intimidating at first but it will become clear very quickly as you look at the provided examples and at the solution steps.
Note: this program works on a half-ring at a time, and does not consider interactions between the half-rings. You may have to figure out how to properly combine the two independent solutions.