Check out Janggi (Korean Chess), our featured variant for December, 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 Mon, Nov 26, 2012 03:06 PM UTC:
Matteo, with this solution you don't account for the case when the king is in check and the king can be protected by the capture of a pawn. I suppose you must enforce the pawn capture in this case, too. So "normal moves" might protect the king without capturing the pawn, although there is such a possibility.

So perhaps you should try the solution I suggested. Add yet another move-type, the highest of the three. To verify that the king is in check you could do like this, for instance (at least if it's white's move) :

a1
(while (on-board? r) ;correction: r
    (if (and (piece? King) friend?) (verify attacked?))
    r    Â ;r is the same as direction e except that h1 is connected with a2, etc.
)
/Mats