Ludii Forum
Sliding a neutral piece - 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: Sliding a neutral piece (/showthread.php?tid=206)



Sliding a neutral piece - Michael - 10-14-2020

Is it impossible to slide a neutral piece, or am I just doing it wrong? I have attached a simple .lud in which I thought each player would slide a neutral piece around, but all you can do is pass.

Edit: I just realized that there is a player called Shared..


RE: Sliding a neutral piece - Eric Piette - 10-14-2020

Hi,

Yes you can use the shared player for that. The shared pieces belongs to each player, the neutral piece to no player.

However, you detected a bug ;) Because I tried to use (forEach Piece Neutral) before to answer to you, and that creates a bug. So we will fix it for the next release.

Thank you for that.

Regards,
Eric


RE: Sliding a neutral piece - Michael - 10-14-2020

Thank you!

I came over something else I don't understand. I tried to use "(sites Direction from:(from) Orthogonal stop:(> (who at:(to)) 0))" with (move <from> <to>) in order to allow movement over neutral pieces. But it "stops" at neutral as well as non-neutral pieces. Isn't the value of (who at:(to)) 0 when there is a neutral piece at (to)? (Also, it doesn't work if I use (site) in place of (to). Is this intended?)

I have attached a .lud that illustrates this.


RE: Sliding a neutral piece - Eric Piette - 10-15-2020

Hi,

That's something already fixed in our dev version (published in the next release).
Yes the owner of Neutral pieces is 0.

Just be careful, if you do that, your slide can also go on the Neutral piece (and will take its place, if that's not a stacking move).

Regards,
Eric


RE: Sliding a neutral piece - paulboes - 11-02-2020

(10-14-2020, 03:27 PM)Eric Piette Wrote: Hi,

Yes you can use the shared player for that. The shared pieces belongs to each player, the neutral piece to no player.

However, you detected a bug ;) Because I tried to use (forEach Piece Neutral) before to answer to you, and that creates a bug. So we will fix it for the next release.

Thank you for that.

Regards,
Eric


Hey, I would actually like to follow up on the original question: How do I use the Shared role to define pieces that every player can move in their turn? From the Language Reference doc, I would see two possible ways but none of them works: Define a piece "Disc" as "Shared" and then place it as a) "Disc" or b) "Disc3" (for a two-player game). a) compiles but doesn't result in legal moves and b) throws an error. (I'm attaching the modification of the OPs file).

Thanks


RE: Sliding a neutral piece - Eric Piette - 11-03-2020

Hi,

The description for a such shared piece with moves defined in them is for example


Code:
(piece "Disc" Shared (move Slide))


(play (forEach Piece Shared))


   

Unfortunately, I just notice that they are triggered an exception in the current version, I already fixed it in our dev version and that will be published in the next release.

Regards,
Eric