Ludii Forum
(site Cell Vertex (from)) documentation - Printable Version

+- Ludii Forum (
+-- Forum: Problems (
+--- Forum: Grammar Problems (
+--- Thread: (site Cell Vertex (from)) documentation (/showthread.php?tid=456)

(site Cell Vertex (from)) documentation - dale walton - 02-24-2021

In a recent thread I asked:
4.What is the difference between the following, and why do they require different board geometries?:

(sites Cell Vertex (from)) --- this one works on the use:vertex board.
(sites Incident Vertex of:Cell at:(from)) --- this one does not work on the use:vertex board.

Eric stated that

The first one is returning the indices of the cells of the vertex from, the second one is returning the list of vertices of the cell from which is not the same.

However the documentation for (sites) states for the Cell parameter something a bit different, and strange:

12.4.4  sitesIndexType
Specifies sets of board sites by some indexed property.

Cell : Vertices that make up a cell.

My understanding is that would mean that in (sites Cell Vertex (from)) the (from) must be a cell and the result is a set of vertices, - which is the opposite of what you have said.
Also, my experience was that it indeed works the way the documenttion says on a board with use:vertex.

Please check it out and make it consistent in the way it works, the way it is documented, and the way you intend.

I had also tried:
(sites Incident Vertex of:Cell at:(from))

I found it did not work on a board with use:vertex If it had, I would gladly have used it because it seems like it has a more general structure.
I believe it did work when use:vertex was not specified, and thus when the board Ludii selected then had space for pieces, on both cells and vertices.

RE: (site Cell Vertex (from)) documentation - Eric Piette - 02-25-2021


Ok I double check.
And I was wrong, both should be the same as far I know (vertices of the cells).
Can you send me a .lud showing that difference?


RE: (site Cell Vertex (from)) documentation - dale walton - 03-02-2021

OK, did some work for you...

Please see the notes in the code.  The code has several Options for how (not) to write the program.

The two statements I thought behave differently, here appear to behave the same way, at least for this use of them (I didn't test in the from statement)

The issues come up in what happens when the specs are missing or mis-matched.  Some of these mismatches hang the component drawing, some affect array indexes, some the base containerSite is out of cell range, Some give invalid cell index ##, etc.

Also, it uncovered a bug where the from location is being altered from its original value, so in the full moves, the selected from cell is mis-recorded and mis-applied.  You should fix this.  And also block/fix any behavior that hangs the program.

Beyond that it is your project, so you can determine how far to take the implementation of the ability to script mixed site type games...