Commit f29f2f17 authored by Saad MAHBOUBI's avatar Saad MAHBOUBI
Browse files

La fonction rookMove completer mais bug (la piece saute les autre

parent bc7daa66
......@@ -188,7 +188,16 @@ export function queenMove(board: Chessboard, move: Move): boolean {
export function rookMove(board: Chessboard, move: Move): boolean {
// #TODO: Implement this function
if (move.from!.rank ===!.rank)
let depart: Square = squareAtPosition(board, move.from!);
let destination: Square = squareAtPosition(board,!);
if (move.from!.rank ===!.rank ){
return isEmpty(board,!) || depart.piece!.isWhite === !destination.piece!.isWhite ;
if (move.from!.file ===!.file ){
return isEmpty(board,!) || depart.piece!.isWhite === !destination.piece!.isWhite ;
return false;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment