Puzzle.js Reference: Dots

Note: while Puzzle.js puzzles store their state locally (via localStorage), that behavior is inhibited on this page to make it easiest to see exactly what markup produces exactly what result.

Overview

Some puzzles have dots that must be connected to draw shapes, mark items, etc. These puzzles may or may not have accompanying grids. With puzzle.js, you can designate non-grid areas as “dot zones” and ask your solvers to draw the lines. These lines are fully integrated with undo, saved state, and co-op functionality.

There are two highly related flavors of dot-to-dot support: freeform and list-based.

Freeform dot-to-dot

Dot coordinates are scaled to the data-dots-view-box attribute if it exists, or the size of the puzzle-dot-zone div if it does not.

You can specify that each dot can have at most one line by setting the data-dots-exclusive attribute.

List-based dot-to-dot

A
B
C
1
2
3

You can specify that each dot can have at most one line by setting the data-dot-exclusive attribute.

A
B
C
1
2
3
A
B
C
1
2
3

Styling