How can I immobilize the king when in... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » How can I immobilize the king when in check? « Previous Next »

Author Message
David Cannon (Davidcannon)
New member
Username: Davidcannon

Post Number: 6
Registered: 2-2009
Posted on Tuesday, March 17, 2009 - 3:31 pm:   

I'm working now on a number of variants in which the King will not be able to escape from check by moving. The only way to break a check will be to capture the enemy piece or to obstruct the check with another piece.

I've tried using the (verify not attacked?) And (if not attacked?) macros, but the former only makes the program crash, and the latter, I found, immobilizes the king, period. Whether he is under attack or not.

What am I doing wrong? Can anybody give me a better idea? Thanks!
David Cannon (Davidcannon)
New member
Username: Davidcannon

Post Number: 7
Registered: 2-2009
Posted on Wednesday, March 18, 2009 - 6:11 am:   

I've just solved the problem - at 1.10 a.m.! In case anybody else wishes to use the code, this is how I did it:

(define royalshift ((verify not-attacked?) $1 (verify not-friend?) add $1))

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: