Check out Grant Acedrex, our featured variant for April, 2024.


[ 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

Interactive diagrams. Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Mon, Jul 11, 2022 02:02 PM UTC in reply to Aurelian Florea from Sun Jul 10 05:11 PM:

This is a test for how to implement immobilizers with the Interactive Diagram, through a user-supplied function BadZone(). The Queen here immobilizes all adjacent enemy pieces.

files=8 ranks=8 promoZone=1 promoChoice=NBRQ graphicsDir=/graphics.dir/alfaeriePNG/ squareSize=50 graphicsType=png pawn:P:ifmnDfmWfceF:pawn:a2,b2,c2,d2,e2,f2,g2,h2,,a7,b7,c7,d7,e7,f7,g7,h7 knight:N:N:knight:b1,g1,,b8,g8 bishop:B:B:bishop:c1,f1,,c8,f8 rook:R:R:rook:a1,h1,,a8,h8 queen:Q:Q:queen:d1,,d8 king:K:KisO2:king:e1,,e8

This was already possible before, by having the function BadZone() examine all board squares adjacent to the origin of the move, and vetoing the move (by returning non-zero) when an enemy immobilizer was found there. This was quite inefficient, though, as it would be done for every potential move of the immobilized piece.

I now changed the Diagram Script such that BadZone() can remember the result of any test it does in a variable 'frozen', set to -1 whenever move generation for a new piece starts. So that it can get the result of a previous test for the same piece from there, rather than redoing the test. And by setting frozen = 100 it can even abort generation of moves for the current piece altogether.