BUG : Rotation like tetris

// --- TETRIS T PIECE (spawn orientation) ---

// Using 1 for blocks, 0 for empty

let currentPiece = [
  [0, 1, 0],
  [1, 1, 1],
  [0, 0, 0],
];

// --- ROTATE FUNCTION (your version) ---

function rotate15degre() {
  for (let ligne = 0; ligne < currentPiece.length; ligne++) {
    for (let colonne = 0; colonne < currentPiece.length; colonne++) {
      currentPiece[ligne][colonne] =
        currentPiece[-colonne + currentPiece.length - 1][ligne];
    }
  }
}
// --- HELPER TO PRINT MATRIX ---

function printMatrix(matrix) {
  console.log(matrix.map((row) => row.join(" ")).join("\n"));
}

// --- TEST BEFORE ROTATION ---

console.log("Before rotation:");
// printMatrix(currentPiece);
console.table(currentPiece);
rotate15degre();
console.table(currentPiece);