From aadd9d7ee89e409accabe5e617dfa3ff223651f4 Mon Sep 17 00:00:00 2001
From: Thomas de Brettes <thomas.de-brettes@etu.ec-lyon.fr>
Date: Tue, 1 Apr 2025 20:56:06 +0200
Subject: [PATCH] Update index.js

---
 htdocs/index.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/htdocs/index.js b/htdocs/index.js
index a534d60..8f12958 100644
--- a/htdocs/index.js
+++ b/htdocs/index.js
@@ -501,12 +501,20 @@ function highlightMoves(tour,piece, row, col) {
             }            
         }
         if (row==0 && col == 4) {//position roi noir d'origine
+<<<<<<< Updated upstream
             if (board[0][3] === ""  && board[0][2] ==="" && board[0][1] ==="" && board[0][0] ==="T"){//rock à gauche 
+=======
+            if (board[0][3] === ""  && board[0][2] ==="" && board[0][1] ==="" && board[0][0] ==="t"){//rock à gauche 
+>>>>>>> Stashed changes
                 let newRow = row;
                 let newCol = 2;
                 moves.push({ row: newRow, col: newCol });
             }
+<<<<<<< Updated upstream
             if (board[0][5] === ""  && board[0][6] ==="" && board[0][7] ==="T"){//rock à droite
+=======
+            if (board[0][5] === ""  && board[0][6] ==="" && board[0][7] ==="t"){//rock à droite
+>>>>>>> Stashed changes
                 let newRow = row;
                 let newCol = 6;
                 moves.push({ row: newRow, col: newCol });
@@ -693,11 +701,14 @@ function movePiece(piece, newRow, newCol) {
                 piece: selectedPiece            // Nom de la pièce (ex: "pion", "tour", etc.)
             }
         });
+<<<<<<< Updated upstream
 
         if (echec(board)){
             socket.emit('echec');
         }
 
+=======
+>>>>>>> Stashed changes
         //Verifie si c'était un rock
         if (piece.toLowerCase() == "k" && Math.abs(newCol-selectedPosition.col)==2){
             if (newCol-selectedPosition.col==2){//rock à droite
@@ -736,7 +747,11 @@ function movePiece(piece, newRow, newCol) {
                         to: { x: 7, y: 3 },        // Position d'arrivée
                         piece: "t"}
                     })
+<<<<<<< Updated upstream
                 } else if (player.isBlackPlayer){
+=======
+                } else {
+>>>>>>> Stashed changes
                     board[0][3]="T"
                     board[0][0]=""
                     socket.emit('roque', {
-- 
GitLab