Commit 1a520eed authored by Maxime PERRIN's avatar Maxime PERRIN
Browse files
parents e1dadb2a f29f2f17
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'devv' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 verbose stack Error: missing script: devv
4 verbose stack at run (/usr/share/npm/lib/run-script.js:147:19)
4 verbose stack at /usr/share/npm/lib/run-script.js:57:5
4 verbose stack at /usr/share/npm/node_modules/read-package-json/read-json.js:345:5
4 verbose stack at checkBinReferences_ (/usr/share/npm/node_modules/read-package-json/read-json.js:309:45)
4 verbose stack at final (/usr/share/npm/node_modules/read-package-json/read-json.js:343:3)
4 verbose stack at then (/usr/share/npm/node_modules/read-package-json/read-json.js:113:5)
4 verbose stack at /usr/share/npm/node_modules/read-package-json/read-json.js:232:12
4 verbose stack at /usr/share/npm/node_modules/graceful-fs/graceful-fs.js:76:16
4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
5 verbose cwd /comptes/E170977U/l1/introdev/onlineChess
6 error Linux 4.10.8
7 error argv "/usr/bin/node" "/usr/bin/npm" "run" "devv"
8 error node v8.10.0
9 error npm v3.5.2
10 error missing script: devv
11 error If you need help, you may report this error at:
11 error <https://github.com/npm/npm/issues>
12 verbose exit [ 1, true ]
......@@ -187,7 +187,19 @@ export function queenMove(board: Chessboard, move: Move): boolean {
*/
export function rookMove(board: Chessboard, move: Move): boolean {
// #TODO: Implement this function
return true;
let depart: Square = squareAtPosition(board, move.from!);
let destination: Square = squareAtPosition(board, move.to!);
if (move.from!.rank === move.to!.rank ){
return isEmpty(board, move.to!) || depart.piece!.isWhite === !destination.piece!.isWhite ;
}
if (move.from!.file === move.to!.file ){
return isEmpty(board, move.to!) || 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