Can't get the "else" move work in "if" - Printable Version +- Ludii Forum (https://ludii.games/forums) +-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13) +--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15) +--- Thread: Can't get the "else" move work in "if" (/showthread.php?tid=244) |
Can't get the "else" move work in "if" - Castux - 11-09-2020 Hello again. Another thing I'm stuck on. In a game where each player has two moves in a row, and I need to do some maintenance at the end of the turn: Code: (play The player can correctly play twice in a row, but the "Refill" is not applied afterwards. Note that "Refill" works when using is simply as "then" or as the first clause of the "if". In case it matters, here is the definition of "Refill": Code: (define "Refill" The player can play one piece of each of their colors during their turn, but not two of the same, so I'm using a hand with one piece of each, that refills at the end of the turn. Thanks! RE: Can't get the "else" move work in "if" - Eric Piette - 11-09-2020 Hi, That's easier for me to help you if you give me a complete .lud to run. Can you? Regards, Eric RE: Can't get the "else" move work in "if" - Castux - 11-09-2020 Sure! I tried also with "HandEmpty", but that doesn't do anything either :/ Code: (define "Refill" Note that I empty the hand before refilling it, because later I'll add the option to pass after placing a single stone. I'm just not there yet. RE: Can't get the "else" move work in "if" - Eric Piette - 11-09-2020 Here the correction to your file to do what you expect. Code: (define "Refill" RE: Can't get the "else" move work in "if" - Castux - 11-09-2020 Amazing, thanks a lot! I didn't realize that "and" could be used to chain non-decision moves. Although, what was technically wrong in the chaining with "then"? RE: Can't get the "else" move work in "if" - Eric Piette - 11-09-2020 Hi, If a site is already empty, the remove Action is not applied (no need). Consequently the consequence of that move is also not applied if the hand is already empty here. So, no move is computed by that ludeme in that really specific case. Regards, Eric RE: Can't get the "else" move work in "if" - Castux - 11-09-2020 That makes a lot of sense. Thanks again! |