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

PawnX: new modest vatiant[Subject Thread] [Add Response]
M Winther wrote on Tue, Nov 20, 2012 05:36 PM UTC:
Sorry, I didn't know that it worked that way. It is generally recommended
for newcomers to Zillions programming to begin with a simpler game. This is
a very, very, complex game. I suppose, the simplest way to solve this is to
introduce yet another move-type which has the highest priority of all. This
move-type is exactly the same as the normal moves (where pawn capture is
not enforced). The only difference is that you must verify that the king is
threatened before execution of this move-type is allowed. So you must loop
through the board squares until you find the friendly king, and verify that
it is threatened. Thus, only if the king is attacked, this priority move
will be executed, and the player can thus make a move that is the same as a
normal move. Should there be no move that can save the king, then Zillions
will signal mate, which is correct. However, for the king itself, it's not
necessary to make this loop, because you can check (verify attacked?) where
it is placed.
/M. Winther