Skip to content

Main content

Random Geometric Area Decomposition Puzzle Generator

Translate nonoverlapping supplied rectangles, hide one width and retain exact reconciled decomposition areas; touching boundaries are permitted.

Loading tool…

Description

Translate nonoverlapping supplied rectangles, hide one width and retain exact reconciled decomposition areas; touching boundaries are permitted.

A generated practice exercise contains a prompt and an answer key under a specific rule set. A planted answer establishes one possible solution; only an explicit enumeration or uniqueness check establishes whether alternatives exist.

Translate nonoverlapping supplied rectangles, hide one width and retain exact reconciled decomposition areas; touching boundaries are permitted.

When to use this tool

Use this generator to create reproducible geometric area decomposition puzzle cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply rectangles, translationMaximum in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read pieces, hiddenIndex, hiddenWidth, totalArea, translation. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Require nonoverlapping integer rectangles, draw a common nonnegative translation, and choose one width to hide as null. Cross-check each area with rectangle and polygon calculators and return piece areas, the total, and hidden width separately.1

Delegated operations used for this result: rectangle area; polygon area. Their calculation or parsing conventions apply to the corresponding result fields.2, 3

Input fieldMeaning and unitsAccepted input
rectanglesRectanglesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
rectangles[].xXRequired. Safe integer.
rectangles[].yYRequired. Safe integer.
rectangles[].widthWidthRequired. Safe integer; minimum 1.
rectangles[].heightHeightRequired. Safe integer; minimum 1.
translationMaximumTranslation MaximumRequired. Safe integer; minimum 0; maximum 1000000.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
piecesPiecesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
pieces[].xXRequired. Safe integer.
pieces[].yYRequired. Safe integer.
pieces[].widthWidthRequired. Safe integer. or Null.
pieces[].heightHeightRequired. Safe integer.
pieces[].areaAreaRequired. Safe integer.
hiddenIndexHidden IndexRequired. Safe integer.
hiddenWidthHidden WidthRequired. Safe integer.
totalAreaTotal AreaRequired. Safe integer.
translationTranslationRequired. Array of Safe integer.; minimum items 2; maximum items 2.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "rectangles": [
      {
        "x": 0,
        "y": 0,
        "width": 2,
        "height": 3
      },
      {
        "x": 2,
        "y": 0,
        "width": 1,
        "height": 3
      }
    ],
    "translationMaximum": 2,
    "seed": 42
  },
  "output": {
    "pieces": [
      {
        "x": 1,
        "y": 1,
        "width": 2,
        "height": 3,
        "area": 6
      },
      {
        "x": 3,
        "y": 1,
        "width": null,
        "height": 3,
        "area": 3
      }
    ],
    "hiddenIndex": 1,
    "hiddenWidth": 1,
    "totalArea": 9,
    "translation": [
      1,
      1
    ],
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Edges may touch without overlap. The piece area and visible height can reveal the missing width. All coordinates and areas must remain safe integers; this is a planted exercise rather than a general area-decomposition solver.
  • A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Geometric Area Decomposition Puzzle Generator — tool.io

  2. Calculation or validation: geometry/rectangle-area — tool.io

  3. Calculation or validation: geometry/polygon-area — tool.io

Similar or alternative tools