08-29-2022, 07:49 AM
Hi,
The ludeme (seq ...) is slightly different. It applies each move one by one, yes, but each move will use the new state created by the previous move applied in the sequence. I will add this clarification in the documentation.
The (and ...) ludeme is used to apply the full list of moves generated by a Moves ludeme before the next one. Without to take in account the modification of the state in between.
A (then ...) ludeme (so a consequence Moves) will use a temporary state after applying the move decided by the player to compute the ludemes and then applying them. The most important to remember with a consequence move is the use of the ludeme (last ...) to have a reference to the `from' and `to' location just used by the player. Other variables can also be used, of course.
The (do ...) ludeme can be used in different ways. With a next:, it will apply the do Moves only if the next Moves computed is not empty. With a ifAfterwards: I will apply a move only if the condition defined is true after applying the move.
It is true, that it would be possible to apply a (seq ...) ludeme no taking in account the state reached by each move. However, this can be obtained in doing what you said with just adding a pass move (always reached) in the (do ....) moves.
If you have an example of a situation in a game that you think this can be done with this. Let me know to think about it :)
Eric
The ludeme (seq ...) is slightly different. It applies each move one by one, yes, but each move will use the new state created by the previous move applied in the sequence. I will add this clarification in the documentation.
The (and ...) ludeme is used to apply the full list of moves generated by a Moves ludeme before the next one. Without to take in account the modification of the state in between.
A (then ...) ludeme (so a consequence Moves) will use a temporary state after applying the move decided by the player to compute the ludemes and then applying them. The most important to remember with a consequence move is the use of the ludeme (last ...) to have a reference to the `from' and `to' location just used by the player. Other variables can also be used, of course.
The (do ...) ludeme can be used in different ways. With a next:, it will apply the do Moves only if the next Moves computed is not empty. With a ifAfterwards: I will apply a move only if the condition defined is true after applying the move.
It is true, that it would be possible to apply a (seq ...) ludeme no taking in account the state reached by each move. However, this can be obtained in doing what you said with just adding a pass move (always reached) in the (do ....) moves.
If you have an example of a situation in a game that you think this can be done with this. Let me know to think about it :)
Eric