{
  "schemaVersion": 1,
  "slug": "yes-or-no-generator-calculator",
  "category": "gaming",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "f61cee862301f6dfedcb5368899738ad2bb2f6eda5d1b68ea3a61f544eea0e17",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/yes-or-no-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": "v = r(seed); answer = Yes if v ≥ 0.5, otherwise No",
    "vars": [
      [
        "v",
        "One pseudo-random draw in [0,1)"
      ],
      [
        "seed",
        "Seed value"
      ],
      [
        "answer",
        "Yes / No outcome"
      ]
    ],
    "note": "One deterministic PRNG step selects the answer. The question text does not affect the draw; the same seed reproduces the same choice. Answer style changes wording only."
  },
  "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": "f61cee862301f6dfedcb5368899738ad2bb2f6eda5d1b68ea3a61f544eea0e17",
    "basis": "v = r(seed); answer = Yes if v ≥ 0.5, otherwise No",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "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 yes=rng(seed)()>=0.5;return {answer:answerStyle==='enthusiastic'?(yes?'Yes!':'No!'):answerStyle==='hedged'?(yes?'Probably yes':'Probably not'):(yes?'Yes':'No')};",
    "inputs": [
      {
        "name": "answerStyle",
        "type": "select",
        "default": "simple",
        "options": [
          {
            "value": "simple"
          },
          {
            "value": "enthusiastic"
          },
          {
            "value": "hedged"
          }
        ]
      },
      {
        "name": "seed",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 1000000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "answer",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
