Fix code for Strong Archer jump move Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Fix code for Strong Archer jump move « Previous Next »

Author Message
Richard VanDeventer (Richv)
New member
Username: Richv

Post Number: 2
Registered: 3-2009
Posted on Tuesday, January 31, 2012 - 9:43 pm:   

For my Chess variant, my move definition for a Strong Archer does not quite do what I want it to do. I want the Strong Archer to be able to move 1, 2, or 3 spaces either by sliding or jumping across corners. Capture can only occur on the second space. The sliding works well, but the jumping is a bit strange. The first and third space are supposed to be empty for the piece to move to it. And the Strong Archer is supposed to be able to only jump over the first space and not the second space. However, the way I have the move coded, it allows the piece to jump over two spaces if the second space is occupied by an enemy piece. It will not allow it to jump two spaces if the second space is occupied by a friendly piece (which is good). Here is the code for the move:

; Archers and Catapults - STRONG
(define leap2ss
(
$1 (if empty? add) $1 (verify not-friend?) add $1 (if empty? add)
)
)

How do I change the code to say that the Strong Archer can only move to the third space if the second space is empty? I have the same problem with my Strong Catapults, which move the same way except across sides instead of across corners.
Larry Wheeler (Brainburner)
New member
Username: Brainburner

Post Number: 2
Registered: 3-2007
Posted on Wednesday, February 01, 2012 - 9:51 am:   

Sorry,it throws away all the indents:

(define leap2ss
(
$1 (if empty? add)
$1 (if empty?
add
$1 (if empty? add)
else
(verify enemy?)
add
)
)
)

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: