diff options
author | IgrisBRC <[email protected]> | 2024-07-17 18:09:36 +0530 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-17 18:09:36 +0530 |
commit | 5123593638f73239de9a1bb1bd287b1d0e87daaf (patch) | |
tree | 95d038d23db29777d8f3d433cbcbe64f64c1bcfd /public/move.js | |
parent | a7e11ff8f729a669d8b2445f066606302ecb1b46 (diff) | |
parent | 438ad19a536dab544b6071c741ab6107bf63dabb (diff) |
Merge pull request #5 from ameliasquires/main
fix castling and cleanliness
Diffstat (limited to 'public/move.js')
-rw-r--r-- | public/move.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public/move.js b/public/move.js index 59badf4..87de976 100644 --- a/public/move.js +++ b/public/move.js @@ -168,7 +168,7 @@ function king_move(board, y, x) { let moves = [] let controlled = controlled_squares(board, to_move) - + for (let i = y - 1; i <= y + 1; i += 1) { for (let j = x - 1; j <= x + 1; j += 1) { if ((i == y && j == x) || i < 0 || j < 0 || i >= board.length || j >= board[i].length) { @@ -179,7 +179,7 @@ function king_move(board, y, x) { } } } - + if (color && castle_white_short && board[7][6] == 0 && board[7][5] == 0) { for (let i = 0; i < controlled.length; i++) { if ((controlled[i][0] == 7 && controlled[i][1] == 6) || (controlled[i][0] == 7 && controlled[i][1] == 5)) { |