Ludii Forum
counting player pieces in orthogonally adjacent cells - 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: counting player pieces in orthogonally adjacent cells (/showthread.php?tid=253)

Pages: 1 2 3 4


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-16-2020

Thanks! So my final question on this topic is how do I only count sites (cells) that are orthogonal in the same layer and only face adjacent (U, D) between layers?

Would counting adjacent sites (cells) that share 4 edges work? When the board is defined as  (board (layers 3 (square 3))), do all sites (cells) get associated with 8 vertices instead of 4?

Alternatively, I could define the Qua 3D game board as playing on vertices, and use single edges as the Orthogonal directions. Please confirm that the Ludii player does not consider vertices that are in diagonal directions across a square as Orthogonal. Also, how would I define the Qua game board as playing on vertices as sites instead of cells?


RE: counting player pieces in orthogonally adjacent cells - Eric Piette - 11-16-2020

You mean by site to look the number of U & D neighbors, right?


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-16-2020

(11-16-2020, 09:57 AM)Eric Piette Wrote: You mean by site to look the number of U & D neighbors, right?
Yes, plus the number of Orthogonal neighbors of an empty (to) site in the N, S, E, W directions. Count how many such neighbors are non-empty and occupied by a piece owned by the current Mover.


RE: counting player pieces in orthogonally adjacent cells - Eric Piette - 11-17-2020

Hi,

Sorry not exactly sure of your last question.
Correct me if that's wrong:

you want to
"Count the number of owned pieces in the directions N, S, E, W, U, D from a specific site"

?

Regards,
Eric


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-17-2020

(11-17-2020, 12:46 PM)Eric Piette Wrote: Hi,

Sorry not exactly sure of your last question.
Correct me if that's wrong:

you want to
"Count the number of owned pieces in the directions N, S, E, W, U, D from a specific site"

?

Regards,
Eric
Yes.

Actually, I want to do something even more complicated.

If the empty (to) site from which the directions for counting is made is in a region owned by the Mover, then add 1 to the count.

Qua is a connection game and the larger goal is to connect the 2 regions owned by a player. When the empty (to) site is on one of the faces of the cube owned by the Mover,  the Mover can connect 1 of its owned pieces to the owned “board face” region instead of another owned piece. 

I believe this can be done using an “(or ...)” operator in the “if”condition?


RE: counting player pieces in orthogonally adjacent cells - Eric Piette - 11-17-2020

This is that game: https://boardgamegeek.com/boardgame/312939/qua

?

Regards,
Eric


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-17-2020

(11-17-2020, 01:24 PM)Eric Piette Wrote: This is that game: https://boardgamegeek.com/boardgame/312939/qua

?

Regards,
Eric
Yes


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-18-2020

FYI- I Attached my current draft of the Qua.lud file.

Several lines begin with // because I am not sure about the syntax for those lines. It currently doesn't compile. Any help would be appreciated!


I also added:
(define "Debug"
    (note ALL
    (topLevel at:(last To))
    )
)
at the top because I saw it in another .lud listing. I do not see this debug option documented anywhere.


RE: counting player pieces in orthogonally adjacent cells - Eric Piette - 11-18-2020

Hi,

Yes that's possible to do what you mean. Unfortunately, the GUI is really not ready for such board, consequently I can not test the description easily. So for the moment, I advice to wait some improvements from the GUI to do a such 3D game.
When the GUI will be ready for 3D game, I am going to implement that game and I will coming back to you.

Regards,
Eric


RE: counting player pieces in orthogonally adjacent cells - QuaGamer - 11-18-2020

Great !

Thanks Eric. I will now wait patiently until I hear from you. I understand that it will be at least several months from now, if not longer. I have other work to do, so the time will pass quickly for me.