| Author |
Message |
Steve Warner (Ceratopsian)
New member Username: Ceratopsian
Post Number: 1 Registered: 12-2007
| | Posted on Sunday, December 30, 2007 - 12:33 pm: | |
I programmed one piece (let's call this piece A)to swap with other pieces(Let's call the "swapee" B). After moving A to swap with B, I want B to perform its usual capture (immediately after the swap, without moving). Can anyone help? |
Sean Duggan (Dream)
New member Username: Dream
Post Number: 74 Registered: 9-2000
| | Posted on Sunday, December 30, 2007 - 6:23 pm: | |
Can you provide any details on how the capture for B works? Or are you looking for this to work in a generic way for a number of different capture situations? |
Greg Schmidt (Gschmidt2)
New member Username: Gschmidt2
Post Number: 47 Registered: 1-2007
| | Posted on Sunday, December 30, 2007 - 9:43 pm: | |
I may not completely understand what you are after, but I assume you want to move a piece A to where a piece B resides (causing the B to become an A) and then have the location which formerly held the A to now become a B. If that's the case, wouldn't this simply be a "move" from A to B followed by a create of piece B at location A? If so, perhaps the "from" keyword may be of some help since it would represent A's location. Sorry if I missed the point. |
Steve Warner (Ceratopsian)
New member Username: Ceratopsian
Post Number: 2 Registered: 12-2007
| | Posted on Monday, December 31, 2007 - 7:38 am: | |
Duggan - B captures all enemy pieces in the 8 adjacent squares. So immediately after the swap I want all enemies surrounding B to be captured. Greg - I have already written the code for the swap. What I'm having trouble with is performing a capture at the end of the swap but during the same turn. |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 49 Registered: 1-2007
| | Posted on Monday, December 31, 2007 - 2:02 pm: | |
To me it seems simple. Just write (capture n) (capture e) and so on. And then write 'add'. /Mats |
Steve Warner (Ceratopsian)
New member Username: Ceratopsian
Post Number: 3 Registered: 12-2007
| | Posted on Monday, December 31, 2007 - 4:51 pm: | |
I finally figured it out. I just needed to use the back command correctly to make sure that piece B was the one capturing. Thanks for your help. Here's one more question. I have a piece that can move 3 spaces freely and I want it to be able to move to its original position (essentially resulting in a skipped turn). Is this possible? |
Greg Schmidt (Gschmidt2)
New member Username: Gschmidt2
Post Number: 48 Registered: 1-2007
| | Posted on Monday, December 31, 2007 - 5:15 pm: | |
The example I sent you allows the piece to be dropped on its origin position effectively skipping your turn. I suppose you could also allow pass moves. |