Ta

ctx.fill(); ctx.strokeStyle = '#aaa'; ctx.stroke();

const COLS = 11; const ROWS = 11; const HEX_SIZE = 25; // Radius of the hexagon

: The player goes first by marking one empty tile as "blocked."

// Fill Color if (type === 1) ctx.fillStyle = '#ffcccc'; // Wall else if (type === 2) ctx.fillStyle = '#ffeb3b'; // Cat Background else ctx.fillStyle = '#f0f0f0'; // Empty

// Draw Cat if (type === 2) ctx.font = '24px Arial'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(catEmoji, px, py);

// 2. BFS to find shortest path to edge const queue = [ x: catPos.x, y: catPos.y, path: [] ]; const visited = new Set(); visited.add(`$catPos.x,$catPos.y`);

: Randomly "block" about 8–12 tiles on the board before starting to ensure the game is winnable but challenging. Game Rules

ctx.closePath();

#game-container position: relative; margin-top: 20px;

The game begins with a cat positioned at the center of a board filled with hexagonal tiles.

if (dist < HEX_SIZE * 0.9) // Click logic if (grid[y][x] === 0 && !(x === catPos.x && y === catPos.y)) grid[y][x] = 1; // Place wall catTurn();