{
  "schemaVersion": 1,
  "slug": "baby-name-generator-calculator",
  "category": "fun",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "5bf76e749548705b2813f8c8f2016d0f725fe3a7f6040153a95d053bc57a9048",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/baby-name-generator-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": "s_k = P_{σ(k)}, k = 1 … n",
    "vars": [
      [
        "P",
        "Ordered candidate-name pool for the chosen style and gender"
      ],
      [
        "σ",
        "Index permutation produced by the seeded pseudo-random generator (Fisher–Yates)"
      ],
      [
        "n",
        "Number of names"
      ],
      [
        "s_k",
        "k-th suggested name"
      ]
    ],
    "note": "Fisher–Yates shuffle with a seeded pseudo-random generator runs from the end backward; the same seed always gives the same order."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const G = { classic: ['Elizabeth', 'Margaret', 'Katherine', 'Charlotte', 'Eleanor', 'Amelia', 'Caroline', 'Beatrice', 'Rose', 'Grace'], modern: ['Aria', 'Nova', 'Willow', 'Harper', 'Sloane', 'Quinn', 'Mila', 'Isla', 'Everly', 'Lyra'], nature: ['Iris', 'Daisy', 'Fern', 'Hazel', 'Juniper', 'Sage', 'Wren', 'Lily', 'Marigold', 'Clover'], vintage: ['Dorothy', 'Edith', 'Mabel', 'Violet', 'Clara', 'Agnes', 'Hattie', 'Ivy', 'Pearl', 'Ruth'] }; const B = { classic: ['William', 'Henry', 'Charles', 'Edward', 'Thomas', 'George', 'Frederick', 'Daniel', 'Samuel', 'Benjamin'], modern: ['Milo', 'Leo', 'Ezra', 'Kai', 'Silas', 'Theo', 'Jasper', 'Rowan', 'Asher', 'Beckett'], nature: ['River', 'Forrest', 'Clay', 'Ash', 'Reed', 'Birch', 'Storm', 'Heath', 'Linden', 'Sage'], vintage: ['Walter', 'Arthur', 'Albert', 'Harold', 'Ernest', 'Clarence', 'Stanley', 'Leonard', 'Howard', 'Edwin'] }; const pool = (gender === 'boy' ? B[style] : gender === 'girl' ? G[style] : B[style].concat(G[style])); const rng = (s) => { let a = Math.floor(s) >>> 0; return () => { a = (a + 0x6D2B79F5) >>> 0; let t = a; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0)/4294967296; }; }; const r = rng(seed); const arr = pool.slice(); for (let i = arr.length - 1; i > 0; i--) { const j = Math.floor(r()*(i + 1)); const tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } return { suggestions: arr.slice(0, count).join(', '), styleUsed: style + ' / ' + gender, totalInPool: pool.length };",
    "inputs": [
      {
        "name": "gender",
        "type": "select",
        "default": "girl",
        "options": [
          {
            "value": "girl"
          },
          {
            "value": "boy"
          },
          {
            "value": "either"
          }
        ]
      },
      {
        "name": "style",
        "type": "select",
        "default": "classic",
        "options": [
          {
            "value": "classic"
          },
          {
            "value": "modern"
          },
          {
            "value": "nature"
          },
          {
            "value": "vintage"
          }
        ]
      },
      {
        "name": "count",
        "type": "number",
        "default": 5,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "seed",
        "type": "number",
        "default": 21,
        "min": 0,
        "max": 1000000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "suggestions",
        "precision": 0,
        "unit": "",
        "type": "text",
        "display": "tokens",
        "separator": ", "
      },
      {
        "name": "styleUsed",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "totalInPool",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
