// Update king position + flags
let kingAppear = { 'w': false, 'b': false };
- for (let i=0; i<smove.appear.length; i++) {
+ for (let i = 0; i < smove.appear.length; i++) {
if (smove.appear[i].p == V.KING) {
const c = smove.appear[i].c;
kingAppear[c] = true;
this.kingPos[c][1] = smove.appear[i].y;
}
}
- for (let i=0; i<smove.vanish.length; i++) {
+ for (let i = 0; i < smove.vanish.length; i++) {
if (smove.vanish[i].p == V.KING) {
const c = smove.vanish[i].c;
if (!kingAppear[c]) {
postUndo(move) {
if (this.turn == 'w') {
- // Reset king positions: scan board
+ // Reset king positions: scan board (TODO: could be more efficient)
this.scanKings();
// Also reset whiteMove
this.whiteMove = null;