summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/app.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/app.js b/public/app.js
index a8db6b2..8de18e4 100644
--- a/public/app.js
+++ b/public/app.js
@@ -41,6 +41,9 @@ function pawn_move(board, y, x) {
if (board[y - 1][x] == 0) {
moves.push([y - 1, x])
}
+ else {
+ return moves
+ }
if (board[y - 2][x] == 0) {
moves.push([y - 2, x])
}
@@ -54,6 +57,9 @@ function pawn_move(board, y, x) {
if (board[y + 1][x] == 0) {
moves.push([y + 1, x])
}
+ else {
+ return moves
+ }
if (board[y + 2][x] == 0) {
moves.push([y + 2, x])
}