Commit 6380b3bf authored by Romain DUPONT's avatar Romain DUPONT
Browse files

importation du mouvement du cavalier

parent 697dd425
......@@ -134,7 +134,10 @@ export function bishopMove(board: Chessboard, move: Move): boolean {
export function knightMove(board: Chessboard, move: Move): boolean {
// #TODO: Implement this function
return true;
return ((Math.abs(!.rank-move.from!.rank)==1 && Math.abs(!.file-move.from!.file)==2) ||
(Math.abs(!.rank-move.from!.rank)==2 && Math.abs(!.file-move.from!.file)==1) );
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