Slide and veer. How? Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Slide and veer. How? « Previous Next »

Author Message
mohamed el mokhtar messaoudi (Dumbguy)
Posted on Wednesday, May 25, 2005 - 1:57 pm:   

Hi.
How could I get a free-sliding piece ( like a chess Queen, Rook or Bishop) to go some unobstructed distance, and then decide to swerve to another direction, all in the same move?
An obvious way is to break down the move to every single possibility ( one step,then turn and slide; two steps, then turn and slide; etc.)
Could not all the steps be coded in one go?
I have tried something with two macros related by an add-partial and a flag. No good.
Thanks for any help.
Keith Carter (Keithc)
Posted on Wednesday, May 25, 2005 - 6:26 pm:   

It sounds to me like you are on the right track. I think the basic structure is

Rook move
add partial
Rook move
add

maybe the flag code was actually working against you. Mind you, I am not one of the more accomplishes scripters around here.
Keith Carter (Keithc)
Posted on Wednesday, May 25, 2005 - 6:27 pm:   

That would be accomplished not accomplishes.
L. Lynn Smith (Interrupt27)
Posted on Wednesday, May 25, 2005 - 10:13 pm:   

Try this:

(define hook-move ($1 (while empty? mark (while (and empty? (on-board? $2)) $2 (if not-friend? add))(if not-marked? back)$1)))

You will call this macro with the two directions which make up the move.

This is in addition to the simple slide.

(define slide ($1 (while empty? add $1)(verify enemy?) add))

This will eliminate the need of partial moves and flags, and reduce the impact on the depth search. Hopefully there are no syntax errors.
mohamed el mokhtar messaoudi (Dumbguy)
Posted on Friday, May 27, 2005 - 2:34 pm:   

Keith and Lynn, thank you both.
The Rook-move macro Lynn supplies works just fine (except that the first cell is excluded from the move; the slide macro takes care of that.)
Thanks again.
L. Lynn Smith (Interrupt27)
Posted on Friday, May 27, 2005 - 3:40 pm:   

The reason for leaving the slide cells out of the hook-move macro was because with several of these hook-moves you would have generated moves to these cells several times. A little redundant.

For example: The hook-moves involving the north/east and north/west translation would both cover the north line of cells. Just as the east/north and east/south would both cover the east line of cells.

You will still end up with a lot of redundat moves as the field becomes clearer. But by then, the few number of pieces on the field should not overburden the depth search.

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: