Zillions Beginner Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Zillions Beginner « Previous Next »

Author Message
Luke Pebody (Bozzball)
Posted on Wednesday, June 16, 2004 - 6:10 am:   

I'm trying to create a game that is a sort of combination of Chess & Othello. It involves chess pieces which move as they normally do, except they cannot capture, but can instead "flip" pieces as in Othello.

I can't work out how to program this in moves.

My idea is to have a macro called flipit:

(define flipit
(if (enemy? $1)
$1
(while (enemy? $1) $1)
(if (friend? $1)
back
(while (enemy? $1) $1 change-owner)
)
back
)
)

and then a slide macro:

(define slide
((verify (am-white?)) $1 (while empty?
(flipit n) (flipit e) (flipit s) (flipit w)
add $1)))

Unfortunately, what this does is that if a piece moves from A1-A4, it will do any possible flipping on each of the squares A2, A3 on the way there.
Sean Duggan (Dream)
Posted on Wednesday, June 16, 2004 - 6:15 am:   

^_^ Well, when you're calling the FlipIt Macro inside the while loops... try
(while empty? $1) back (flipit n) (flipit e) (flipit s) (flipit w) add
Luke Pebody (Bozzball)
Posted on Wednesday, June 16, 2004 - 6:17 am:   

Won't that only allow a piece to move as far as it possibly can?
Sean Duggan (Dream)
Posted on Wednesday, June 16, 2004 - 6:22 am:   

You know, that's true. You're going to have to find some way of only doing a single flipit for each square you do an add for... the problem you currently have is that your flipits convert eavery piece around them without committing to an actual move. Therefore, each square you travel, you build them up. Hmmm... I'm going to have to ponder a bit. If all else fails, if the board is a finite size, you can rig it by doing one for moving one, one for moving two, etc, but I'm sure you'd prefer to avoid that.
Luke Pebody (Bozzball)
Posted on Wednesday, June 16, 2004 - 6:38 am:   

could i set an attribute called (flipped?) or something on each piece i flip, and then have an unflipit macro that is called after the add?
Luke Pebody (Bozzball)
Posted on Wednesday, June 16, 2004 - 7:04 am:   

I hadn't tried it. It actually does what it's supposed to do. If it moves from a1-a4, it doesn't do the flipping for square a3. My question now is, why?

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: