![]() |
Nonempty cells treated as empty - Printable Version +- Ludii Forum (https://ludii.games/forums) +-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5) +--- Forum: Game Problems (https://ludii.games/forums/forumdisplay.php?fid=17) +--- Thread: Nonempty cells treated as empty (/showthread.php?tid=516) |
Nonempty cells treated as empty - Michael - 03-23-2021 In the attached game there is an add-move. Here is the define: Code: (define "Deploy" RE: Nonempty cells treated as empty - Eric Piette - 03-23-2021 Hi, I will check why a bit later but in the meantime you can just do the following define which is safer and more efficient than using (sites Empty) here. Code: (define "Deploy" Regards, Eric RE: Nonempty cells treated as empty - Michael - 03-23-2021 Thanks! That seems to make everything fine :) Is there a rule of thumb for what ought to go in the region function and what ought to go in the if-parameter of (to) and (from)? RE: Nonempty cells treated as empty - Eric Piette - 03-23-2021 Hi, In reality here, the (sites Empty) should work, that's probably just a bug related to the stack state, I will check and fix it when I will time to do it. For your question, not really, except when of course a region has no sense for the moves because that's implied by the move type (like for the step moves, that's implied by the directions of the move), in which case only a condition will work. But I think if I would have to give you a kind of rule, when the region is not state dependent (like (sites Board) or (sites Top)) that's better to use a RegionFunction because we pre-compute them, so its use is instantaneous compare to a BooleanFunction which will be run at each state to compute the next legal moves. But when the region is not static (so dependent of a state like (sites Empty)) a condition is better, because you do not need to compute all the empty sites but only the sites you need and check if they are empty. Regards, Eric |