Skip to content

Commit

Permalink
board evaluation - getting movements of piece from - to
Browse files Browse the repository at this point in the history
  • Loading branch information
99dino committed Jul 31, 2023
1 parent 5d0995d commit 5651b1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,14 @@ function evaluateBoard(game, move, prevSum, color) {
prevSum -= 50;
}
}
// from (x,y)
var from = [
8 - parseInt(move.from[1]),
move.from.charCodeAt(0) - "a".charCodeAt(0),
];
// to(x,y)
var to = [
8 - parseInt(move.to[1]),
move.to.charCodeAt(0) - "a".charCodeAt(0),
];
}

0 comments on commit 5651b1f

Please sign in to comment.