File size: 1,135 Bytes
502af73
 
466436b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { TrigoGame } = require("../../inc/trigo/trigoGame.js");
const { StoneType } = require("../../inc/trigo/game.js");

const game = new TrigoGame({ x: 5, y: 5, z: 1 });
game.startGame();

console.log("=== Testing 2D Capture ===");
game.drop({ x: 2, y: 2, z: 0 }); // Black
console.log("After move 1, board[3][2][0]:", game.getBoard()[3][2][0]);
game.drop({ x: 3, y: 2, z: 0 }); // White (target)
console.log("After move 2, board[3][2][0]:", game.getBoard()[3][2][0]);
game.drop({ x: 4, y: 2, z: 0 }); // Black
console.log("After move 3, board[3][2][0]:", game.getBoard()[3][2][0]);
game.drop({ x: 3, y: 1, z: 0 }); // White elsewhere
game.drop({ x: 3, y: 3, z: 0 }); // Black
console.log("After move 5, board[3][2][0]:", game.getBoard()[3][2][0]);
game.drop({ x: 1, y: 1, z: 0 }); // White elsewhere
game.drop({ x: 2, y: 1, z: 0 }); // Black - should capture

console.log("\nAfter final move:");
console.log("board[3][2][0]:", game.getBoard()[3][2][0], "(should be 0/EMPTY if captured)");
console.log("Last step capturedPositions:", game.getLastStep()?.capturedPositions);
console.log("Captured counts:", game.getCapturedCounts());