{
  "schemaVersion": 1,
  "slug": "pizza-party-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "a5372f84b3607b3ccd3ec604eb9d73bb8b1aae38ce8730039fdf890a6042d970",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pizza-party-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "n = ceil(G × a ÷ s); C = n × P",
    "vars": [
      [
        "n",
        "Pizzas needed"
      ],
      [
        "G",
        "Guests"
      ],
      [
        "a",
        "Slices per person"
      ],
      [
        "s",
        "Slices per pizza"
      ],
      [
        "C",
        "Total cost"
      ]
    ],
    "note": "a = 2/3/4 (light/normal/heavy); rounded up; total area = n × π(d÷2)²."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const per = appetite === 'light' ? 2 : appetite === 'heavy' ? 4 : 3; const slices = guests*per; const pizzas = Math.ceil(slices/slicesPerPizza); const area = pizzas*Math.PI*Math.pow(pizzaDiameter/2, 2); return { slicesNeeded: slices, pizzas: pizzas, slicesPerPerson: pizzas*slicesPerPizza/guests, totalCost: pizzas*costPerPizza, costPerPerson: guests > 0 ? pizzas*costPerPizza/guests : 0, squareInches: area };",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "appetite",
        "type": "select",
        "default": "average",
        "options": [
          {
            "value": "light"
          },
          {
            "value": "average"
          },
          {
            "value": "heavy"
          }
        ]
      },
      {
        "name": "slicesPerPizza",
        "type": "number",
        "default": 8,
        "min": 4,
        "max": 24,
        "step": 1,
        "slider": true
      },
      {
        "name": "pizzaDiameter",
        "type": "number",
        "default": 14,
        "min": 8,
        "max": 24,
        "step": 1,
        "slider": true
      },
      {
        "name": "costPerPizza",
        "type": "number",
        "default": 15,
        "min": 0,
        "max": 200,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "slicesNeeded",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "pizzas",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "slicesPerPerson",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "totalCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "costPerPerson",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "squareInches",
        "precision": 0,
        "unit": "sq in"
      }
    ],
    "interpret": null
  }
}
