Tested Related to Check Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Desired Features for Zillions of Games » Tested Related to Check « Previous Next »

Author Message
Peter Aronson (Peteraronson)
Posted on Friday, April 13, 2001 - 2:50 pm:   

There are handful of additional tests associated with check that could be very helpful:

has-been-checked?
(has-been-checked? <direction>
(has-been-checked? <position>

Returns true if the piece indicated is included in a checkmate goal and has in a previous turn been checked, and false otherwise. (Having it return true if currently in check is unnecessary, since attacked? will tell you that.) There is no clean way of implementing this currently that I know of.

This would be useful in implemented the extinct Malay form of Chess, where a King could make a Knight's move up to and including when it had been checked, but not after.

in-check?

A global test that would return true if the current player is in check, and false otherwise. This can be done now by scanning the board for the King, and using attacked?, but this is expensive, or by adding a high priority move-type for the King that sets a flag to the value of attacked?, but does not perform an add, but this still expensive, and unsupported to boot, and anyway, Zillions knows you're in check already.

offering-check?
(offering-check? <direction>)
(offering-check? <location>)

This would return true if the piece indicated was offering check to any of the current player's royal pieces.

Both of the above tests would be useful to in implementing pieces that were only allowed to capture in order to break check, such as the Civilian in Chess'3.

(can-mate <true|false>)

This is not actually a test, but part of a piece definition. This is for pieces that can offer check, but not actual checkmate. If (can-mate false), the royal piece still has to treat the piece's attack as a check, but the piece can not actually mate.

This can be used to implement the Knight (Mori) in Shatar.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: