The Chess Variant Pages

[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Atomic chess. Pieces explode when captured. (8x8, Cells: 64) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on 2019-11-21 UTC

This is a test for how the Interactive Diagram can be used for variants with extensive side effects to their moves, by means of an (optionally) custom-supplied JavaScript function WeirdPromotion(fromX, fromY, toX, toY, promotionType) embedded in the HTML of the page that contains the diagram. This function originally was intended for specifying promotions not covered by the normal promotion rules (based on the specified promotion-zone size and the promoChoice or promoOffset parameters). E.g. for when a contageous piece is captured, for implementing non-rectangular promotion zones, or for vetoing certain choices dependent on the board rank where the promotion takes place.

promoChoice=QNBR graphicsDir=../membergraphics/MSelven-chess/ whitePrefix=w blackPrefix=b graphicsType=png symmetry=none pawn::::a2,b2,c2,d2,e2,f2,g2,h2,,a7,b7,c7,d7,e7,f7,g7,h7 knight:N:::b1,g1,,b8,g8 bishop::::c1,f1,,c8,f8 rook::::a1,h1,,a8,h8 queen::::d1,,d8 king::::e1,,e8

But the function can also be used to modify the board in squares not touched by the move ('side effects'). In Atomic Chess captures have a rather drastic side effect: the piece itself, and all surrounding non-Pawns of either color will disappear! The function WeirdPromotion supplied with this page takes care of clearing the board around the to-square in the required way. There is one snag: to cause disappearance of the capturer as well, it has to be erased on its from-square, as the routine is executed before the move is made. So clearing the to-square erases the capture victim, but the capturer will still be moved to it afterwards, and thus has to be erased pre-emptively.