Design a jigsaw puzzle game. A picture is cut into pieces, the player drags pieces onto a board, and the game tells whether a piece fits where it is placed. The puzzle is done when every piece is in place.
It must
- A puzzle is a grid of pieces; each piece has four edges (top, right, bottom, left).
- Each edge is a tab, a blank or flat (border pieces have flat sides).
- Two pieces fit when the touching edges are opposite shapes and match.
- The player places a piece at a cell; the board accepts it only if it fits its neighbours.
- The puzzle is solved when all cells are filled.
Keep in mind
- A piece can be in only one place at a time.
- Fit checking must not depend on screen coordinates.
- Drawing and dragging are out of scope: the design is the model.