08-04-2020, 09:30 AM
I'm trying to implement Yinsh. I can't quite figure out how to act on the detected line of components.
I can detect a line anywhere on the board with some difficulty:
(if (is Line 5 throughAny:(sites Occupied by:P1) what:(id "Disc1"))
The throughAny argument has to be there, or it will only detect lines going through the (last To) location by my experimentation (again, a lack of source code to the core Ludii ludemes, and the rather bare bones documentation means a lot of trial and error in figuring these things out, and this seems to be uncharted territory so the existing game files aren't much help). Puzzlingly enough, throughAny:(sites All) doesn't work!
Now for the trickier bit -- I have to remove the pieces that form the line. Is there any way to get a list of the sites that form the line for passing to (remove)?
I've tried this to no effect (thinking I could filter out all sites that have a line of 5 going through them).
(remove (forEach (sites Occupied by:P1) if:(is Line 5 through:(site) what:(id "Disc1"))))
P.S. Can you make "Disable Smilies" the default for the forum, given how often Ludii code is quoted here.
I can detect a line anywhere on the board with some difficulty:
(if (is Line 5 throughAny:(sites Occupied by:P1) what:(id "Disc1"))
The throughAny argument has to be there, or it will only detect lines going through the (last To) location by my experimentation (again, a lack of source code to the core Ludii ludemes, and the rather bare bones documentation means a lot of trial and error in figuring these things out, and this seems to be uncharted territory so the existing game files aren't much help). Puzzlingly enough, throughAny:(sites All) doesn't work!
Now for the trickier bit -- I have to remove the pieces that form the line. Is there any way to get a list of the sites that form the line for passing to (remove)?
I've tried this to no effect (thinking I could filter out all sites that have a line of 5 going through them).
(remove (forEach (sites Occupied by:P1) if:(is Line 5 through:(site) what:(id "Disc1"))))
P.S. Can you make "Disable Smilies" the default for the forum, given how often Ludii code is quoted here.