Double Kings: Checkmate Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Double Kings: Checkmate « Previous Next »

Author Message
Ken Franklin (Kenz)
Posted on Friday, November 15, 2002 - 12:44 pm:   

I have 1 or 2 (or 3) on-board Kings in a chess game.
How can I set win/loss condition by checkmate IF there isn't another 'free' on-board King.
ie; A double checkmate on 2 Kings is correct, a single checkmate on 1 King is correct, but a single checkmate against 2 Kings - not enough, the second King is 'free to move'.
Don Rogers (Patzer42)
Posted on Sunday, November 17, 2002 - 1:03 am:   

Here's a method that I think ought to work. Maybe someone else has a better way?

Define three different piece types, called King, King2 and King3, with identical properties. Then set the loss-condition something like this:

(loss-condition (White Black)
(and
(or (checkmated King) (pieces-remaining King 0))
(or (checkmated King2) (pieces-remaining King2 0))
(or (checkmated King3) (pieces-remaining King3 0))
)
)
Ken Franklin (Kenz)
Posted on Monday, November 18, 2002 - 12:36 pm:   

That's sort of what I thought - but:
I always get Parse Errors when trying to combine (checkmated King) (with another condition).

In Squadron Chess, I used two separate conditions - they were exclusive. Here in a 'promotion style' the conditions have to gel with checkmated.
Jeff Mallett (Jeffm)
Posted on Monday, November 18, 2002 - 2:36 pm:   

checkmated, stalemated, captured and repetition goals must all be at the top-level, i.e. not underneath an "or".
Peter Aronson (Peteraronson)
Posted on Tuesday, November 19, 2002 - 9:31 am:   

I've solved this problem a couple of times -- I use an indirect capture target. For an example,
see:

http://www.chessvariants.com/programs.dir/zillions/full-double-chess.zip

Basically the actual checkmate target is a dummy piece called the High-King (sorry about the formatting, but I can't seem to stop everything from going to the left):


(loss-condition (White Black) (checkmated High-King))

(piece
(name High-King)
(dummy)
)


There's also a second dummy piece called the Doorman, and each side's start in a pair of dummy squares:


(dummy Black-Hall Black-Throne White-Hall White-Throne)
(links next (Black-Hall Black-Throne) (White-Hall White-Throne))

(board-setup
(White
. . .
(King h1 i1)
(Doorman White-Hall)
(High-King White-Throne)
)
(Black
. . .
(King h8 i8)
(Doorman Black-Hall)
(High-King Black-Throne)
)
)


Every add that could be a capture is a macro with the following check:


(define king-check
(if (piece? King)
to
(if (am-white)
Black-Hall
else
White-Hall
)
(if empty? next)
capture
(go to)
)
)

(define add-and-flag
(set-attribute can-castle? false)
(king-check)
add
)


Thus, capturing the first King is normal, but once its gone, so's the Doorman, so any threat to capture the 2nd King also threatens the High-King.

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: