Constraints
Constraints are sets of values that define a puzzle under investigation. They include a board, a set of pieces, and a list of true/false flags that define rules for the puzzle. Constraints are passed to a solver program that finds and records all solutions to a puzzle.
These are meant for tiling puzzles (use polycubes/polyominos to fill a footprint with no gaps or overlaps) and packing puzzles (pack a set of polycubes into a specified volume)
Constraint Type
Types of constraints:
- Template: An abstract puzzle definition. Defines a category of puzzles (eg: same constraints and pieces, but over many different board sizes/shapes).
- Generated: An instance of a template- a concrete puzzle definition. Fixed values for all settings.
Board and Piece Supply
The board is a finite list of coordinates that define a 2D or 3D space that will be filled by pieces.
The piece supply is the set of pieces that can be used to fill the board. Each piece has a set quantity (finite or infinite).
Constraint Flags
Constraint flags are true/false values defining rules for a puzzle. Here's a list of constraint flags and what they mean.
Gaps
- 🫥 allowGaps: If true, pieces don't have to fully cover the board. By default this is false.
Overflow: Pieces extending beyond their board's footprint.
-
🌊 allowGroundLevelOverflow: If true, pieces can extend beyond the footprint of their board, on the bottom level. By default this is false.
-
🌧️ allowSkyLevelOverflow: If true, pieces can extend beyond the footprint of their board, above the bottom level. By default this is false.
-
🏙️ allowUpwardOverflow: If true, pieces can extend upward. This lets us reuse a simple 2D board for 3D puzzles of any height, as long as they don't need a ceiling. By default this is false. This is overridden to true in Clones Tile A Rectangle - Restricted Neighbors, Overhang City.
Overhangs: where a piece (or part of a piece) is above a different piece or empty space.
-
🪑 allowUnsupportedOverhangs: If true, overhangs over empty space are allowed. By default this is false.
-
💺 allowSupportedOverhangs: If true, overhangs over other pieces are allowed. By default this is false. This is overridden to true in Overhang City, Angel Cube.
-
✈️ allowSkyPieces: If true, pieces can be placed without any part touching the bottom level. By default this is false. This is overridden to true in Angel Cube.
Coloring: preventing similar pieces from being placed together. At most one of these can be true. If none of these are true and there are color restrictions enabled, all pieces get the same color.
- 🫛 colorByPiece: If true, each piece is assigned its own color. If a piece is added to supply multiple times, each gets its own color. By default this is false. This is overridden to true in Tatami Tiling - 3 color variation.
- 🍊 colorByOrientation: If true, each piece orientation gives the piece its own color (a cube has 6 colors). By default this is false. This is overridden to true in Clones Tile A Rectangle - Restricted Neighbors.
- 🍏 colorByDistinctOrientation: If true, each distinct piece orientation gives the piece its own color (a cube has 1 color). By default this is false.
Color-Based Restrictions: how close is allowed? If all of these are true, coloring has no effect.
-
👉 allowColorVertexNeighbors: If true, same colors can meet at a vertex. By default this is true. This is overridden to false in Clones Tile A Rectangle - Restricted Neighbors, Tatami Tiling - 3 color variation.
-
🔪 allowColorEdgeNeighbors: If true, same colors can meet at an edge. By default this is true.
-
😡 allowColorFaceNeighbors: If true, same colors can meet on a face. By default this is true.
-
🙈 allowHiddenNeighborsToBreakColorRules: If true, color rules are not applied to pieces where the relevant meeting is buried/hidden in the solved state. By default this is true.
-
🌋 allowGroundFloorToBreakColorRules: If true, color rules are not applied to pieces where the relevant meeting is on the bottom level. By default this is false.
Other Restrictions on how pieces meet:
- 🚦 allow4PieceEdgeIntersections: If true, four pieces are allowed to meet at an intersection. Used in flat 2D puzzles. By default this is true. This is overridden to false in Tatami Tiling - Classic.
Turning Pieces
- 🌪️ allowPieceRotation: If true, pieces can be rotated in place (ie, keeping the same face down). By default this is true. This is overridden to false in Locked Triangles.
- 🎲 allowPieceOrienting: If true, pieces can be flipped to a different face (like rolling dice). By default this is true. This is overridden to false in Tatami Tiling - Classic, Tatami Tiling - 3 color variation, P-Pentominos, Locked Triangles.
- 🪞 allowPieceMirroring: If true, pieces can be reflected along the x-axis. Useful for 2D puzzles. By default this is false.
Leftovers: does the solution have to be exhaustive?
-
🗑️ allowUnusedOrientations: If true, the solution can omit piece orientations. This allows for 2D puzzles. By default this is true.
-
🚮 allowUnusedPieces: If true, the solution can omit entire pieces. If false, every piece must be used. Not applied to puzzles with infinite pieces in their supply. By default this is false. This is overridden to true in Tatami Tiling - 3 color variation.