White to get massive advantage early on
Details
Author: | Mark |
Rating: | |
Difficulty: | Beginner |
Date: | 5th January 2021 |
Description: | It's white's turn, and they can deal a massive blow to black early in the game. |
Code
//Please feel welcome to copy this code for your own creations.
fromFen("k2r1bnr/pp1bpppp/1qnp4/1Bp5/4P3/2NP1N2/PPPB1PPP/R2Q1RK1 w Qk - 0 1");
info("It's White's turn, and it's time to deal a massive blow to Black.");
let steps = ["Nd5", "Qxb5", "Nc7+", "Kb8", "Nxb5"];
onPieceClicked(function(squareName) {
unhighlightAll();
if(squareName == sourceOfSan(steps[0])) {
return true;
} else {
highlightSquareRed(squareName);
return false;
}
});
onMoveAttempted(function(san) {
if(san == steps[0]) {
steps.shift();
if(steps.length > 0) {
setTimeout(function() {
performMove(steps[0]);
steps.shift();
}, 500);
} else {
complete();
info(" ");
}
return true;
} else {
return false;
}
});