| Author |
Message |
Ken Franklin (Kenz)
| | Posted on Tuesday, February 24, 2004 - 9:47 pm: | |
eg; (while empty? add n) eg; cascade (defined action on another piece) How may a Cascade be placed into a While section such as within a bishop's sliding move? Remembering that there is following piece action for such a slide move. |
Sean Duggan (Dream)
| | Posted on Wednesday, February 25, 2004 - 6:12 am: | |
Could you explain further what you wish to do with this move? I could give you all kinds of pieces of code, but they do little good if they answer the wrong question. Do you want it such that the bishop slides until he runs into a condition (piece already there, piece adjacent to him, etc), then move that piece after settling down? Or do you want something like, along the bishops move, any pawns in his path, he allows them to make one pawn move as he goes along? |
Ken Franklin (Kenz)
| | Posted on Wednesday, February 25, 2004 - 11:45 am: | |
The Cascade (Action) works already. It alters a completely different piece elsewhere - no matter whether the bishop moves 1..n empty places or also captures. In most move blocks I simply place the cascade (action) after the normal piece step statements just in front of the ending Add. With the (specific while empty? add $1 'slide section') I've tried various uncertain arrangements to work with and around the (While's ADD). If after the bracketed slide's add section with a return to the Bishop before completing the verify portion - possibly a 3rd add is needed. Or should the opening $1 be moved after the cascade? eg. ($1 (while empty? add $1) cascade (action) add BACK??? (verify not-friend?) add) |
Sean Duggan (Dream)
| | Posted on Wednesday, February 25, 2004 - 4:56 pm: | |
Ah, I'm starting to see what you mean. Just to be sure I understand things properly, you want the bishop to, if he runs into a friendly piece along his way, create the cascade, right? But just the first piece, right? ($1 (while empty? add $1) (if friend? cascade (action) else add))) That will slide you so long as there are empty squares. If the square is not empty it is either a friend's piece or an enemy piece. If it's a friendly piece, we cascade our action. If it's an enemy piece, we take it. Is that what you wanted? If not, please describe the situation you want to piece to move in, as I'm just not getting it. |
Ken Franklin (Kenz)
| | Posted on Wednesday, February 25, 2004 - 10:16 pm: | |
Sorry no. I want a normal slide move WITH a independent cascade (action) attached to every potential result of the normal slide move. |
Sean Duggan (Dream)
| | Posted on Wednesday, February 25, 2004 - 10:21 pm: | |
Could you give me a for instance? I'm guessing you mean that we've got a bishop moving along his diagonal and at every spot, if a certain condition is met, the piece indicated by that spot and condition has a cascaded move? *sigh* If you could describe how you want your piece to move, it would really be a help in us helping you... |
Ken Franklin (Kenz)
| | Posted on Thursday, February 26, 2004 - 9:04 am: | |
There is no 'certain' condition. Bishop moves - anywhere capture/ empty square - doesn't matter. Then, say (example cascade) Pawn at y2 moves one square north - there is no relationship between the two pieces involved at all. I have the independent cascade (action) fine - it's placing the movement of the 2nd piece via a cascade that isn't working. This cascade (action) isn't a piece swapper like when castling. |
Karl Scherer (Karl)
| | Posted on Sunday, February 29, 2004 - 3:56 am: | |
Hi Ken, I doubt that you can a squeeze a cascade command into a (while...add) sliding loop in order to move an additional, unrelated piece. If you cannot figure it out (which I expect will happen), I suggest you try one of the following two less elegant ways to encode it: 1. solution For each sliding distance, create a separate move. Here is it easy to incorporate the cascade. 2. solution Do not use a cascade at all and use a (capture / create) combination instead, which simulates a move. Hence you code will look like this: (while ... (call submacro doing capture/create for other piece)...add) I hope this helps. Cheers, Karl |
Ken Franklin (Kenz)
| | Posted on Wednesday, March 03, 2004 - 5:10 pm: | |
As it turned out, for my current game, I didn't require a cascade at all. The game is Double_Alternate Chess. I appreciate the assistance though. I had almost completed solution 1's method before giving my far-flung no-cascade idea a last-hope try. |
Alfred Pfeiffer (Apf)
New member Username: Apf
Post Number: 15 Registered: 7-2000
| | Posted on Wednesday, February 18, 2009 - 1:11 pm: | |
A late answer to the initial question: "How to build a while cycle with a cascade action in it?" The crucial point is the "from" position. It is located usally (also within the while loop) at the initial position of the moving piece. But a cascade command changes the the "from". Therefore you have to reset (after an add) the "from" pointer back to the initial position of the sliding piece before you build its next step in the cycle. I tested this successfully in a simple zrf. (Game: RushHour, not published, but if you like to get it, send an eMail to me) Friendly greetings, Alfred Pfeiffer |
|