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/personalities/buzz_stinger.js
/*
* Tetgame Rabbot: Buzz Stinger
*
* Starter personality brain. Tetgame supplies legal moves in ctx.tokenMoves
* and ctx.tetMoves; this file only chooses among those legal moves.
* Voice lines live separately in js/voices/buzz_stinger.json.
*/
(function(global){
'use strict';
const registry = global.TetgameRabbotBrains = global.TetgameRabbotBrains || {};
function cloneMove(move, fallbackReason){
if (!move) return null;
const copy = Object.assign({}, move);
if (!copy.reason && fallbackReason) copy.reason = fallbackReason;
return copy;
}
function moveAt(list, index){
return Array.isArray(list) && list.length > index ? list[index] : null;
}
function pass(reason){
return {type:'pass', score:-1, reason:reason || 'no legal action found'};
}
function canOpen(ctx){
return ctx && ctx.tetCount <= 0;
}
function openingLimit(ctx, extra){
const active = Number(ctx && ctx.activeCount || 2);
return Math.max(2, Math.min(5, active + Number(extra || 1)));
}
registry.buzz_stinger = {
key:'buzz_stinger',
id:'buzz_stinger',
name:'Buzz Stinger',
level:1,
style:'fast pressure striker',
temperament:'small moves with sharp consequences',
chooseMove(ctx){
if (!ctx || ctx.matchEnded || ctx.tournamentEnded) return null;
if (canOpen(ctx)) return {type:'start_tet', score:1000, reason:'open the first position'};
const token0 = moveAt(ctx.tokenMoves, 0);
const token1 = moveAt(ctx.tokenMoves, 1);
const token2 = moveAt(ctx.tokenMoves, 2);
const tet0 = moveAt(ctx.tetMoves, 0);
const tet1 = moveAt(ctx.tetMoves, 1);
const boardLocked = !!ctx.boardLocked;
const firstAction = Number(ctx.turnActionCount || 0) === 0;
const tetCount = Number(ctx.tetCount || 0);
switch ('stinger') {
case 'opportunist':
if (token0 && Number(token0.score || 0) >= 6) return cloneMove(token0, 'take the exposed opening');
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 2)) return cloneMove(tet0, 'spread the shadow line');
return cloneMove(token0, 'take the available mark') || cloneMove(tet0, 'expand where the board loosens') || pass();
case 'territorial':
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 3)) return cloneMove(tet0, 'build a lasting border');
if (token0 && Number(token0.score || 0) >= 7) return cloneMove(token0, 'seal the valuable point');
return cloneMove(tet0, 'extend the territory') || cloneMove(token0, 'hold the ground') || pass();
case 'mirror':
if (token1 && Number(token0 && token0.score || 0) - Number(token1.score || 0) <= 2) return cloneMove(token1, 'answer from the echo line');
if (!boardLocked && tet1 && firstAction && tetCount < openingLimit(ctx, 1)) return cloneMove(tet1, 'repeat the board at an angle');
return cloneMove(token0, 'answer the strongest pattern') || cloneMove(tet0, 'echo the expansion') || pass();
case 'scramble':
if (token0) return cloneMove(token0, 'dart into the loose opening');
if (!boardLocked && (tet1 || tet0)) return cloneMove(tet1 || tet0, 'skitter to new ground');
return pass();
case 'stinger':
if (token0 && Number(token0.score || 0) >= 5) return cloneMove(token0, 'strike the live socket');
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 1)) return cloneMove(tet0, 'open a sharper lane');
return cloneMove(token0, 'sting the nearest point') || cloneMove(tet0, 'move the pressure forward') || pass();
case 'hammer':
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 3)) return cloneMove(tet0, 'set the next heavy stone');
if (token0 && Number(token0.score || 0) >= 6) return cloneMove(token0, 'hammer the strongest joint');
return cloneMove(tet0, 'build before striking') || cloneMove(token0, 'strike the available joint') || pass();
case 'glacier':
if (token0 && Number(token0.score || 0) >= 8) return cloneMove(token0, 'freeze the high-value line');
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 2)) return cloneMove(tet0, 'advance the slow front');
if (token1 && Number(token1.score || 0) >= 6) return cloneMove(token1, 'choose the colder second line');
return cloneMove(token0, 'hold the cleanest point') || cloneMove(tet0, 'extend carefully') || pass();
case 'fang':
if (token0) return cloneMove(token0, Number(token0.score || 0) >= 7 ? 'bite the exposed line' : 'close on the nearest socket');
if (!boardLocked && tet0) return cloneMove(tet0, 'move the fight closer');
return pass();
case 'trap':
if (token2 && Number(token0 && token0.score || 0) - Number(token2.score || 0) <= 3) return cloneMove(token2, 'hide the threat in a quiet socket');
if (token1 && Number(token0 && token0.score || 0) - Number(token1.score || 0) <= 2) return cloneMove(token1, 'set the second line');
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 2)) return cloneMove(tet0, 'fold the board into a trap');
return cloneMove(token0, 'take the visible trapdoor') || cloneMove(tet0, 'open hidden space') || pass();
case 'pistolero':
if (token0 && Number(token0.score || 0) >= 4) return cloneMove(token0, 'draw on the bright target');
if (!boardLocked && tet0 && firstAction && tetCount < openingLimit(ctx, 1)) return cloneMove(tet0, 'open the firing lane');
return cloneMove(token0, 'take the fastest shot') || cloneMove(tet0, 'shift to a new angle') || pass();
case 'flow':
default:
if (token0 && (!tet0 || Number(token0.score || 0) >= Number(tet0.score || 0) - 1)) return cloneMove(token0, 'follow the strongest current');
if (!boardLocked && tet0) return cloneMove(tet0, 'open the next wave');
return cloneMove(token0, 'settle into the available point') || pass();
}
}
};
})(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.
