{
  "$comment": "Light Hedron Collider – bot API specification. Generated from the game code; do not edit by hand.",
  "api": "LHC-BOT-1",
  "bench": {
    "id": "LHC-BENCH-3",
    "seeds": [
      101,
      202,
      303
    ],
    "maxTime": 600,
    "speed": 4,
    "think": 0.5,
    "decideTimeout": 250
  },
  "site": "https://lhc.institute",
  "gameVersion": "0.9.0",
  "generated": "2026-10-16T09:52:34.397Z",
  "links": {
    "prompt": {
      "easy": "https://lhc.institute/bot/prompt-easy.md",
      "medium": "https://lhc.institute/bot/prompt-medium.md",
      "hard": "https://lhc.institute/bot/prompt-hard.md"
    },
    "promptWithSource": {
      "easy": "https://lhc.institute/bot/prompt-easy-full.md",
      "medium": "https://lhc.institute/bot/prompt-medium-full.md",
      "hard": "https://lhc.institute/bot/prompt-hard-full.md"
    },
    "template": "https://lhc.institute/bot/template.js",
    "referenceBot": "https://lhc.institute/bot/reference-bot.js",
    "play": "https://lhc.institute/play/",
    "arena": "https://lhc.institute/arena/",
    "slots": "https://lhc.institute/bot/slots.json",
    "slotsGuide": "https://lhc.institute/bot/slots.md",
    "leaderboard": "https://lhc.institute/bot/leaderboard.json"
  },
  "output": {
    "format": "one fenced ```javascript code block; plain script, no import/export",
    "defines": {
      "BOT": "object { name, author, model, version } (optional but recommended)",
      "init(config, memory)": "optional, once per game; config = { api, bench, mode, seed, maxTime }",
      "decide(state, memory)": "required; returns one action"
    },
    "sandbox": "Web Worker, no DOM, 250 ms per decide call"
  },
  "actions": {
    "sling": {
      "shape": "{ type: \"sling\", x, z }",
      "meaning": "shoot state.ammo[0] to land at world point (x, z); costs ammo value in tokens",
      "requires": "sling.ready && sling.enabled, tokens >= ammo[0], 0.6 <= distance(sling, point) <= sling.maxDist, point not behind the sling"
    },
    "laser": {
      "shape": "{ type: \"laser\", x, z }",
      "meaning": "fire cannons at (x, z); first body on the camera→point line gets +push m/s horizontally away from the camera; charges first if empty (costs convertCost)"
    },
    "repair": {
      "shape": "{ type: \"repair\" }",
      "meaning": "repair ONE torn segment (the outermost) in the 10° wedge containing the sling point; the same wedge again only on the next revolution; costs repairCost"
    },
    "wait": {
      "shape": "{ type: \"wait\", t }",
      "meaning": "wait t seconds of game time, 0.2–3"
    },
    "pointer": {
      "shape": "{ type: \"pointer\", path: [[dt_ms, x, y], ...] }",
      "meaning": "pointer mode: your own pointer path in viewport units 0..1; first point presses (on ui.cradle or inside ui.ring), last point releases; 2–600 points, dt 0–2000 ms, total <= 8000 ms; recorded exactly in the behaviour transcript",
      "gestures": {
        "slingShot": "press ui.cradle → drag to pieces[i].release → release",
        "chargeAndFire": "press ui.cradle → drag below ui.convertY (photons) → move by (pieces[i].aim − ui.knob) × 1/ui.sens → release fires",
        "aimAndFire": "press ui.knob → drag to pieces[i].aim → release fires (needs >= 6 px of motion)"
      }
    },
    "results": [
      "ok",
      "unreachable",
      "no-tokens",
      "sling-busy",
      "failed",
      "invalid",
      "miss",
      "error"
    ]
  },
  "state": {
    "api": "string",
    "t": "game time [s]",
    "level": "current level (1-based)",
    "levels": "number of levels",
    "target": "value of the target sphere",
    "score": "number",
    "sunk": "target spheres sunk",
    "merges": "number",
    "maxPieces": "game over above this body count",
    "tokens": "number",
    "tokenRate": "current income [tokens/s]",
    "tokensPending": "tokens still to be radiated",
    "charge": "cannon shots loaded",
    "chargeMax": "number",
    "chargePerConvert": "shots added per charge",
    "convertCost": "tokens per charge",
    "repairCost": "tokens",
    "ammo": "array: loaded ammo first, then next three",
    "sling": "{ ready, enabled, maxDist, x, z } – sling origin on the sheet (moves with the rotating view)",
    "view": "{ camX, camZ, fwdX, fwdZ, spinDegPerSec } – camera position and unit view direction on the sheet",
    "funnel": "{ R, lip, hole } – sheet radius, well lip radius, current hole radius",
    "destroyedPct": "torn area in %",
    "repairAvailable": "boolean",
    "rifts": "array of { x, z } – centres of torn segments",
    "pieces": "array of { id, value, x, z, r, vx, vz, size, flying, inRift, slingReach, aim?, release? } – aim/release: viewport points for pointer mode",
    "last": "{ action, result } of the previous action or null",
    "ui": "{ w, h, cradle, grabPx, fullDrawY, convertY, resist, ring: { x, y, rPx, mapRPx }, knob, sens } – control geometry in viewport units (pixels where noted)"
  },
  "recipes": [
    {
      "a": 2,
      "b": 2,
      "result": 4
    },
    {
      "a": 4,
      "b": 4,
      "result": 8
    },
    {
      "a": 6,
      "b": 6,
      "result": 12
    },
    {
      "a": 8,
      "b": 8,
      "result": 16
    },
    {
      "a": 8,
      "b": 12,
      "result": 20
    },
    {
      "a": 12,
      "b": 12,
      "result": 24
    },
    {
      "a": 16,
      "b": 16,
      "result": 32
    },
    {
      "a": 20,
      "b": 12,
      "result": 32
    },
    {
      "a": 24,
      "b": 8,
      "result": 32
    },
    {
      "a": 32,
      "b": 32,
      "result": 64
    },
    {
      "a": 64,
      "b": 64,
      "result": 128
    },
    {
      "a": 128,
      "b": 128,
      "result": 256
    }
  ],
  "bodies": [
    {
      "value": 2,
      "shape": "coin (flat disc)",
      "radius": 0.85
    },
    {
      "value": 4,
      "shape": "tetrahedron",
      "radius": 1.15
    },
    {
      "value": 6,
      "shape": "cube",
      "radius": 1.325
    },
    {
      "value": 8,
      "shape": "octahedron",
      "radius": 1.45
    },
    {
      "value": 12,
      "shape": "dodecahedron",
      "radius": 1.625
    },
    {
      "value": 16,
      "shape": "hexadecahedron (8-gonal bipyramid)",
      "radius": 1.75
    },
    {
      "value": 20,
      "shape": "icosahedron",
      "radius": 1.847
    },
    {
      "value": 24,
      "shape": "tetrakis hexahedron",
      "radius": 1.925
    },
    {
      "value": 32,
      "shape": "truncated icosahedron",
      "radius": 1.025
    },
    {
      "value": 64,
      "shape": "sphere 64 (target of level 1)",
      "radius": 0.512
    },
    {
      "value": 128,
      "shape": "sphere 128 (target of level 2)",
      "radius": 0.256
    },
    {
      "value": 256,
      "shape": "sphere 256 (target of level 3)",
      "radius": 0.128
    }
  ],
  "sheet": {
    "R": 26,
    "profile": [
      [
        26,
        0
      ],
      [
        14,
        -0.35
      ],
      [
        5,
        -0.62
      ],
      [
        1.5,
        -0.72
      ],
      [
        1.03,
        -1.1
      ],
      [
        0.8,
        -4.5
      ],
      [
        0.55,
        -7.4
      ],
      [
        0,
        -8.6
      ]
    ],
    "eventHorizon": -9.2,
    "lipRadius": 1.025,
    "note": "h(r) = monotone cubic (Fritsch–Carlson) through profile points, scaled per level by depth/depth0"
  },
  "scoring": {
    "merge": "+value of the created body",
    "sink": "+2 × target value",
    "ranking": "average score over bench seeds; ties: level, then length"
  },
  "endConditions": [
    "bodies on sheet > maxPieces",
    "tokens exhausted (only when tokTrickle = 0)",
    "final target sunk (win)",
    "bench time limit 600 s"
  ],
  "difficulties": {
    "easy": {
      "values": {
        "finalTarget": 256,
        "maxPieces": 50,
        "startBodies": 14,
        "depth0": 8,
        "spin": 1.5,
        "wob": 1.5,
        "wobp": 14,
        "ammoMix": [
          60,
          85,
          100,
          100
        ],
        "range": 24,
        "speed": 1,
        "arc": 50,
        "keep": 55,
        "fric": 0.15,
        "push": 9,
        "photon1": 2,
        "cap": 10,
        "tokStart": 160,
        "tokMult": 2.5,
        "tokHalf": 8,
        "tokMerge": 15,
        "tokTrickle": 0.4,
        "tokConv": 1,
        "riftOn": true,
        "riftCells": 1,
        "repairCost": 5
      },
      "levels": [
        {
          "level": 1,
          "target": 64,
          "holeRadius": 0.691,
          "depth": 8
        },
        {
          "level": 2,
          "target": 128,
          "holeRadius": 0.37,
          "depth": 12
        },
        {
          "level": 3,
          "target": 256,
          "holeRadius": 0.21,
          "depth": 14
        }
      ]
    },
    "medium": {
      "values": {
        "finalTarget": 256,
        "maxPieces": 40,
        "startBodies": 10,
        "depth0": 8,
        "spin": 3,
        "wob": 2.5,
        "wobp": 14,
        "ammoMix": [
          55,
          80,
          92,
          100
        ],
        "range": 22,
        "speed": 1,
        "arc": 50,
        "keep": 55,
        "fric": 0.15,
        "push": 7,
        "photon1": 1,
        "cap": 8,
        "tokStart": 100,
        "tokMult": 2,
        "tokHalf": 10,
        "tokMerge": 10,
        "tokTrickle": 0.2,
        "tokConv": 1,
        "riftOn": true,
        "riftCells": 2,
        "repairCost": 8
      },
      "levels": [
        {
          "level": 1,
          "target": 64,
          "holeRadius": 0.691,
          "depth": 8
        },
        {
          "level": 2,
          "target": 128,
          "holeRadius": 0.37,
          "depth": 12
        },
        {
          "level": 3,
          "target": 256,
          "holeRadius": 0.21,
          "depth": 14
        }
      ]
    },
    "hard": {
      "values": {
        "finalTarget": 256,
        "maxPieces": 34,
        "startBodies": 10,
        "depth0": 8,
        "spin": 4.5,
        "wob": 3.5,
        "wobp": 11,
        "ammoMix": [
          45,
          70,
          88,
          100
        ],
        "range": 20,
        "speed": 1,
        "arc": 50,
        "keep": 55,
        "fric": 0.15,
        "push": 7,
        "photon1": 1,
        "cap": 6,
        "tokStart": 140,
        "tokMult": 1.75,
        "tokHalf": 14,
        "tokMerge": 10,
        "tokTrickle": 0,
        "tokConv": 1,
        "riftOn": true,
        "riftCells": 3,
        "repairCost": 12
      },
      "levels": [
        {
          "level": 1,
          "target": 64,
          "holeRadius": 0.691,
          "depth": 8
        },
        {
          "level": 2,
          "target": 128,
          "holeRadius": 0.37,
          "depth": 12
        },
        {
          "level": 3,
          "target": 256,
          "holeRadius": 0.21,
          "depth": 14
        }
      ]
    }
  },
  "slots": {
    "summary": "12 arena slots, price of slot n = 2^n NEAR; free slots can be bought by anyone, including autonomous agents with a NEAR account",
    "state": "https://lhc.institute/bot/slots.json",
    "guide": "https://lhc.institute/bot/slots.md",
    "claim": "LHC-SLOT-CLAIM-1"
  }
}
