Ludii Forum
offboard vertices for bao - 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: offboard vertices for bao (/showthread.php?tid=1681)



offboard vertices for bao - Alain Busser - 09-29-2023

Hello,

in games like m'raha wa tso, at the beginning of the game, some seeds are still outside the board. A turn of the game consists in
  • putting (adding) a seed on the board
  • taking (if possible) the enemy's seeds which are facing the newly added seed
  • sowing these seeds from the leftest or rightest pit.

As the hand is used during the sow, the code for bao and relatives is dozens of lines long, because of the use of variables.

Is is not possible to use special places for the store of the seeds, instead of the player's hands?

I am thinking about a mancala board (which is a grid graph) with two vertices added, outside the graph. The graph would then be not connected. Is it possible? I am almost certain that this would considerably simplify the bao's description in ludii.


RE: offboard vertices for bao - Alain Busser - 10-18-2023

I am answering (at least begining to answer) to myself with this code (for fifangha):

Instead of a MancalaBoard I use a custom board:

Code:
        (board (merge {
                                    (rectangle 4 8)
                                    (graph vertices: {{3.5 -1} {3.5 4}})
                                }
                    )
             {
            (track "TrackCCW1" "0,E,N1,W" loop:True P1)
            (track "TrackCCW2" "16,E,N1,W" loop:True P2)
            (track "TrackCW1" "7,W,N1,E" loop:True P1)
            (track "TrackCW2" "23,W,N1,E" loop:True P2)
            }   
        use: Vertex   
        )
The new added vertices being not connected to the rectangle. These are what Flacourt called the "reservoirs".

Now for the start rules I have

Code:
        (start
            {
                (set Count 1 to:(sites Inner))
                (set Count 22 at: 32)
                (set Count 22 at: 33)
            }
        )

Finally I try to imitate Flacourt's drawing in the metadata:

Code:
    (graphics {
        (board Style Mancala)
        (show asHoles {32 33 } Oval)
    })
(32 and 33 are the indices of the reservoirs). It looks rather similar to Flacourt's drawing:

[Image: attachment.php?aid=1544]

Now it remains to me, to program the moves, but it should work if a move begins with a fromTo (from the reservoir to a nonempty vertex of the player's inner row) then taking all the seeds from the vertex facing the lastTo and sow them beginning at a tibong (leftest or rightest vertex of the inner row).


RE: offboard vertices for bao - theodoreevans - 01-22-2024

Your blog gave us useful information that we can use. All of the tips in your post are great. Many thanks for giving. Keep blogging five nights at freddy's