Commit 7485c707 by Erwan Bousse

### Retire le TODO "En passant"

parent 47293549
 ... @@ -10,13 +10,11 @@ import { equals, left, right, top, bottom } from "./position"; ... @@ -10,13 +10,11 @@ import { equals, left, right, top, bottom } from "./position"; * diagram); or the pawn can capture an opponent's piece on a square diagonally * diagram); or the pawn can capture an opponent's piece on a square diagonally * in front of it on an adjacent file, by moving to that square (black "x"s). * in front of it on an adjacent file, by moving to that square (black "x"s). * * * A pawn has two special moves: the en passant capture and promotion. * * * @param board The chessboard of the current game * @param board The chessboard of the current game * @param move * @param move */ */ export function blackPawnMove(board: Chessboard, move: Move): boolean { export function blackPawnMove(board: Chessboard, move: Move): boolean { // #TODO: Manage special 'En passant' move. if (equals(move.to!, bottom(move.from!))) { if (equals(move.to!, bottom(move.from!))) { //console.log("Single forward"); //console.log("Single forward"); ... @@ -43,13 +41,11 @@ export function blackPawnMove(board: Chessboard, move: Move): boolean { ... @@ -43,13 +41,11 @@ export function blackPawnMove(board: Chessboard, move: Move): boolean { * the diagram); or the pawn can capture an opponent's piece on a square diagonally * the diagram); or the pawn can capture an opponent's piece on a square diagonally * in front of it on an adjacent file, by moving to that square (black "x"s). * in front of it on an adjacent file, by moving to that square (black "x"s). * * * A pawn has two special moves: the en passant capture and promotion. * * * @param board The chessboard of the current game * @param board The chessboard of the current game * @param move * @param move */ */ export function whitePawnMove(board: Chessboard, move: Move): boolean { export function whitePawnMove(board: Chessboard, move: Move): boolean { // #TODO: Manage special 'En passant' move. if (equals(move.to!, top(move.from!))) { if (equals(move.to!, top(move.from!))) { return isEmpty(board, move.to!); return isEmpty(board, move.to!); ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!