H. G. Muller wrote on Sun, Nov 17, 2019 06:35 PM UTC:
Treating the Bishop conversion rule as a piece-type change in the Interactive Diagram through a custom function WeirdPromotion() embedded as JavaScript in the HTML page:
function WeirdPromotion(x1, y1, x2, y2, promo) {
var piece = board[y1][x1]; // moved piece
var type = piece & 511; // strip off color and virginity bits
if(type == 6) { // convertable Bishop
promo = piece - 3; // demotes to Bishop
var partner_x = 8 - x1; // start location of other
if((board[y1][partner_x] - piece & 2047) == 0) // contains same piece (igore backround color flags)
board[y1][partner_x] = ((x1 ^ x2 ^ y1 ^ y2) & 1 ? piece - 3 : piece + 1); // demote partner to B or W
} else if(typ == 7) promo = piece - 4; // converting Bishop always promotes to Bishop
return promo;
}
Treating the Bishop conversion rule as a piece-type change in the Interactive Diagram through a custom function WeirdPromotion() embedded as JavaScript in the HTML page: