{
  "schemaVersion": 1,
  "slug": "would-you-rather-generator-calculator",
  "category": "fun",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "c9e9573eaed66b90f87044e9bb1ec23a756c453e60e4720dc25ead42f8062531",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/would-you-rather-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": "i = ⌊r(seed) × n⌋ mod n; pair = C[category][i]",
    "vars": [
      [
        "i",
        "Selected pair index"
      ],
      [
        "seed",
        "Seed value"
      ],
      [
        "n",
        "Pairs in the category (4)"
      ],
      [
        "r",
        "First PRNG output in [0,1)"
      ]
    ],
    "note": "Table lookup. PRNG, one step: a = floor(seed); a ← (a + 0x6D2B79F5) mod 2^32; after mixing, r = (t xor (t >>> 14)) / 2^32. The same seed and category always return the same dilemma; the pick only records your vote."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "MDN — Pseudorandom numbers and reproducibility limitations",
        "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "c9e9573eaed66b90f87044e9bb1ec23a756c453e60e4720dc25ead42f8062531",
    "basis": "i = ⌊r(seed) × n⌋ mod n; pair = C[category][i]",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const C = { everyday: [['Never queue anywhere again', 'Never wait on hold again'], ['Always be ten minutes early', 'Always have perfect weather'], ['Never lose your keys', 'Never forget a name'], ['Get eight hours of sleep every night', 'Never need coffee again']], food: [['Only eat your favourite meal forever', 'Never repeat a meal again'], ['Give up cheese', 'Give up chocolate'], ['Always cook at home', 'Always eat out for free'], ['Spicy every meal', 'Bland but perfectly cooked']], travel: [['Free flights for life', 'Free hotels for life'], ['Only travel within your country', 'Travel abroad but never return to the same place'], ['Always fly first class', 'Always get an extra week off'], ['Speak every language', 'Never get jet lag']], superpower: [['Read minds', 'See one day into the future'], ['Teleport anywhere', 'Freeze time for an hour a day'], ['Invisibility', 'Flight'], ['Never need sleep', 'Never need food']], tech: [['No social media for a year', 'No streaming for a year'], ['Phone from ten years ago', 'Computer from ten years ago'], ['Perfect memory of everything you read', 'Perfect memory of every conversation'], ['Always online', 'Completely off the grid']] }; 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 pool = C[category] || C.everyday; const pair = pool[Math.floor(r()*pool.length) % pool.length]; const pick = yourChoice === 'a' ? pair[0] : yourChoice === 'b' ? pair[1] : 'Undecided'; return { optionA: pair[0], optionB: pair[1], yourChoice: pick, categoryUsed: category };",
    "inputs": [
      {
        "name": "category",
        "type": "select",
        "default": "everyday",
        "options": [
          {
            "value": "everyday"
          },
          {
            "value": "food"
          },
          {
            "value": "travel"
          },
          {
            "value": "superpower"
          },
          {
            "value": "tech"
          }
        ]
      },
      {
        "name": "seed",
        "type": "number",
        "default": 55,
        "min": 0,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "yourChoice",
        "type": "select",
        "default": "a",
        "options": [
          {
            "value": "a"
          },
          {
            "value": "b"
          },
          {
            "value": "undecided"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "optionA",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "optionB",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "yourChoice",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "categoryUsed",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
