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/scuttle_bay.js

/*
 * Tetgame Voice Loader: Scuttle Bay
 *
 * Editable voice text lives in js/voices/scuttle_bay.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": "scuttle_bay",
    "id": "scuttle_bay",
    "name": "Scuttle Bay",
    "gender": "",
    "style": "nimble opportunist",
    "format": "tetgame_voice_v1",
    "notes": "Editable voice data. js/voices/scuttle_bay.js registers this same data for browser use."
  },
  "move": {
    "start_tet": [
      "First one in the tidepool wins the good rock.",
      "I will start where things can slip.",
      "The board looks loose enough."
    ],
    "tet": [
      "More room to scuttle.",
      "That face opens a dockside shortcut.",
      "I like a board with escape routes."
    ],
    "token_center": [
      "The middle is a busy little harbor.",
      "I will sit where everything bumps together.",
      "That center will cause trouble."
    ],
    "token_high_score": [
      "Oho, that one has snacks.",
      "Too useful to leave floating.",
      "I saw that shiny opening."
    ],
    "token": [
      "Quick mark. Quick getaway.",
      "I will tuck this here.",
      "That spot will do nicely."
    ],
    "pass": [
      "Nothing worth snatching.",
      "I will drift a moment.",
      "No need to splash yet."
    ],
    "default": [
      "Tides change fast."
    ]
  }
};

  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';
    if (move.type === 'tet') return 'tet';
    if (move.type === 'token') {
      const reason = String(move.reason || '').toLowerCase();
      if (reason.includes(':10') || reason.includes('center')) return 'token_center';
      if (Number(move.score || 0) >= 8) return 'token_high_score';
      return 'token';
    }
    if (move.type === 'pass') return 'pass';
    return 'default';
  }

  function registerVoiceData(data){
    const voiceData = data && data.move ? data : fallbackVoiceData;
    dataRegistry.scuttle_bay = voiceData;
    voiceRegistry.scuttle_bay = {
      key:'scuttle_bay',
      id:'scuttle_bay',
      name:(voiceData.meta && voiceData.meta.name) || 'Scuttle Bay',
      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/scuttle_bay.json', {cache:'no-store'})
      .then(response => response && response.ok ? response.json() : null)
      .then(data => { if (data) registerVoiceData(data); })
      .catch(() => {});
  }
})(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.