Tetgame mark
Tetgame deep-code room

The Diamond Mine

Inspect Tetgame Rabbot behavior files and prepare the future safe editor for strategy tuning.

Welcome guest — sign in through the Trigame front door when you are ready.
Log in via Trigame

Diamond Mine

The Tetgame answer to the Gold Room.

Read-only starter

The Diamond Mine is intended to expose the deeper machinery of Tetgame Rabbots: behavior files, scoring nudges, strategy filters, voice loaders, backups, and eventually safe editing tools.

Current pass: this page only lists and displays local Tetgame JS/JSON files from js/rabbots, js/personalities, and js/voices. It does not save changes yet.

Behavior / voice file viewer

js/voices/grim_pharaoh.js

/*
 * Tetgame Voice Loader: Grim Pharaoh
 *
 * Editable voice text lives in js/voices/grim_pharaoh.json.
 * This wrapper registers a fallback copy immediately, then refreshes from
 * the JSON file when served normally.
 */
(function(global){
  'use strict';

  const fallbackVoiceData = {
  "meta": {
    "key": "grim_pharaoh",
    "id": "grim_pharaoh",
    "name": "Grim Pharaoh",
    "gender": "male",
    "style": "tomb architect",
    "format": "tetgame_voice_v1",
    "notes": "Editable voice data. js/voices/grim_pharaoh.js registers this same data for browser use. v2 shifts Grim from polite territory keeper to sealed-tomb tactician."
  },
  "move": {
    "start_tet": [
      "All empires begin with one stone.",
      "I place the first monument.",
      "Time starts here."
    ],
    "tet_chamber": [
      "A chamber must be shaped before it can be sealed.",
      "This wall is not a gift. It is a trap.",
      "Let them enter. The tomb remembers the door."
    ],
    "tet_boundary": [
      "A border is stronger than a boast.",
      "This wall will outlive haste.",
      "The kingdom grows one guarded face at a time."
    ],
    "tet": [
      "Another wall. Another boundary.",
      "This face will remember me.",
      "The structure grows more obedient."
    ],
    "token_throne": [
      "The center is a throne, not a socket.",
      "I will sit at the still point.",
      "The middle must be claimed before it awakens."
    ],
    "token_tomb": [
      "The tomb closes.",
      "Three doors shut as one.",
      "This chamber belongs to the dead and to me."
    ],
    "token_heavy_tribute": [
      "The board pays double tribute.",
      "Two lines kneel at once.",
      "A rich seal. Worth waiting for."
    ],
    "token_tribute": [
      "A rich line should pay tribute.",
      "This point yields more than dust.",
      "I collect what the board owes."
    ],
    "token_seal": [
      "Sealed. Let the others learn the border.",
      "A patient mark becomes law.",
      "This socket joins the kingdom."
    ],
    "token": [
      "A small seal for a long reign.",
      "Marked. Preserved. Claimed.",
      "This point joins the kingdom."
    ],
    "pass": [
      "Even kings wait.",
      "The old game is patience.",
      "No decree is needed yet."
    ],
    "default": [
      "The board will kneel in time."
    ]
  }
};

  const dataRegistry = global.TetgameRabbotVoiceData = global.TetgameRabbotVoiceData || {};
  const voiceRegistry = global.TetgameRabbotVoices = global.TetgameRabbotVoices || {};

  function pick(lines, seed){
    if (!Array.isArray(lines) || !lines.length) return '';
    const n = Number(seed || 0);
    const index = Math.abs(Math.floor(n)) % lines.length;
    return lines[index] || lines[0] || '';
  }

  function moveBucket(move){
    if (!move) return 'pass';
    if (move.type === 'start_tet') return 'start_tet';
    const reason = String(move.reason || '').toLowerCase();
    const score = Number(move.score || 0);

    if (move.type === 'tet') {
      if (reason.includes('chamber') || reason.includes('trap') || reason.includes('guarded')) return 'tet_chamber';
      if (reason.includes('boundary') || reason.includes('kingdom') || reason.includes('monument') || reason.includes('wall')) return 'tet_boundary';
      return 'tet';
    }

    if (move.type === 'token') {
      if (reason.includes('close the tomb') || score >= 23) return 'token_tomb';
      if (reason.includes('heavy tribute') || score >= 15) return 'token_heavy_tribute';
      if (reason.includes(':10') || reason.includes('center') || reason.includes('throne')) return 'token_throne';
      if (reason.includes('tribute') || score >= 7.6) return 'token_tribute';
      if (reason.includes('seal')) return 'token_seal';
      return 'token';
    }

    if (move.type === 'pass') return 'pass';
    return 'default';
  }

  function registerVoiceData(data){
    const voiceData = data && data.move ? data : fallbackVoiceData;
    dataRegistry.grim_pharaoh = voiceData;
    voiceRegistry.grim_pharaoh = {
      key:'grim_pharaoh',
      id:'grim_pharaoh',
      name:(voiceData.meta && voiceData.meta.name) || 'Grim Pharaoh',
      gender:(voiceData.meta && voiceData.meta.gender) || '',
      style:(voiceData.meta && voiceData.meta.style) || '',
      data:voiceData,

      lineForMove(move, ctx){
        const bucket = moveBucket(move);
        const lines = (voiceData.move && (voiceData.move[bucket] || voiceData.move.default)) || [];
        const seed = (move && move.score ? move.score * 100 : 0) + (ctx && ctx.playerId ? String(ctx.playerId).length : 0);
        return pick(lines, seed);
      }
    };
  }

  registerVoiceData(fallbackVoiceData);

  if (global.fetch) {
    fetch('js/voices/grim_pharaoh.json', {cache:'no-store'})
      .then(response => response && response.ok ? response.json() : null)
      .then(data => { if (data) registerVoiceData(data); })
      .catch(() => { /* fallback already registered */ });
  }
})(window);

Future safe editor shape

Borrowing the Gold Room idea without mixing Trigame and Tetgame logic.

Read original

Keep an original snapshot before the first edit.

Edit safe sections

Expose selected behavior sections without letting the page damage wrapper code.

Test in Tetgame

Save, then jump back to the Blue Room or board to test the Rabbot live.