12-01-2020, 06:57 AM
I don't think I understand how (priority) works. I thought it was like this:
(priority (if this move is legal, you must do this, otherwise) (you may do this))
But it doesn't seem to work that way. In my game, I have the following:
Or, in essence:
I would think that the result is that, if you can <move> such that <boolean> becomes true, you must. Otherwise there is no restriction on <move>.
Since I obviously have misunderstood, my question is both (1) what is my mistake, and (2) how do I get the intended effect, then?
I'm sorry that I don't have a simple test.lud. I'm hoping it is possible to answer my question based on the description I have given above.
(priority (if this move is legal, you must do this, otherwise) (you may do this))
But it doesn't seem to work that way. In my game, I have the following:
Code:
(play
(priority
(do
(or {
(forEach Piece ("MoveZeroStack") Neutral top:true)
(forEach Piece ("MoveWholeStack") Mover top:true)
(forEach Piece ("MoveStackPart") Mover top:true)
})
ifAfterwards:(or {
("Capturable" NNW)
("Capturable" W)
("Capturable" SSW)
("Capturable" SSE)
("Capturable" E)
("Capturable" NNE)
})
)
(or {
(forEach Piece ("MoveZeroStack") Neutral top:true)
(forEach Piece ("MoveWholeStack") Mover top:true)
(forEach Piece ("MoveStackPart") Mover top:true)
})
)
)
Code:
(play
(priority
(do
<move>
ifAfterwards:<boolean>
)
<move>
)
)
Since I obviously have misunderstood, my question is both (1) what is my mistake, and (2) how do I get the intended effect, then?
I'm sorry that I don't have a simple test.lud. I'm hoping it is possible to answer my question based on the description I have given above.