summaryrefslogtreecommitdiff
path: root/public/move.js
diff options
context:
space:
mode:
authorame <[email protected]>2024-07-17 01:09:18 -0500
committerame <[email protected]>2024-07-17 01:09:18 -0500
commit67051d65f3094750f96023cba2c676afd60ded4e (patch)
treea7416b96977af9e2fe35ff8b974a19bc6ac0d564 /public/move.js
parenta7e11ff8f729a669d8b2445f066606302ecb1b46 (diff)
fix castling and cleanliness
Diffstat (limited to 'public/move.js')
-rw-r--r--public/move.js4
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)) {