Ludii Forum
"move Hop" is non reading correctly the "from" section? - Printable Version

+- Ludii Forum (
+-- Forum: Problems (
+--- Forum: Grammar Problems (
+--- Thread: "move Hop" is non reading correctly the "from" section? (/showthread.php?tid=1531)

"move Hop" is non reading correctly the "from" section? - DiegoDsD - 04-05-2023

Hi, first of all I want to say that I'm quite new to programming in Ludii Language, so I'm not sure if that's an issue of Ludii or it's just me not fully understanding the 'Hop' ludeme.

I have had two situations where the "move Hop" seemed to not read correctly the "from" section inside it, so I've created two demo .lud which describes these situations: 

  • "moveHopFromProblem(levelCase).lud"

It seems to me that 'move Hop' is not reading the level from which to pick the piece and for then make it hop.
In cell 23, there's a knight at level:0, and a Disc at level:1.

The (move <from> <to>) works correctly, in fact, if cell 23 is selected and then cell 48 is clicked, the knight will move and not the disc. (because of (from (site) level:0)).

But (move Hop ...) doesn't seem to work in the same way, in fact, if we make hop cell 23 to cell 37, the disc will be moved, although the from is still (from (site) level:0).

It seems that move Hop is considering the default level value, which is the top of the stack I believe. We can see this also in the second demo.

  • moveHopFromProblem(CompleteFromCase)

In this demo it seems to me that 'move Hop' is not reading at all the 'from' which section.

Basically these are the moves that should be possible: any piece can move to the first empty space after having jumped 1 or more pieces, but before the jump it can also walk into empty                                                                    cells in a straight line.

This does not happen, instead what happens is that possible moves are the ones that should appear if the 'from' section in (move Hop ...) is to it's default, which I believe is (from).

Thanks in advance.