Ludii Forum
Trouble using largeStack with dice - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Grammar Problems (https://ludii.games/forums/forumdisplay.php?fid=24)
+--- Thread: Trouble using largeStack with dice (/showthread.php?tid=1093)



Trouble using largeStack with dice - loganf - 07-22-2022

I'm attempting to implement a stacking game with potentially very large stacks. Possible moves are also determined by a dice roll. But, if I initialize the dice and use the command
Code:
largeStack:True
 within the board, it is unable to correctly index which player occupies a site. I believe it is counting the shared dice as players as, if I run
Code:
(who at:(site))
it consistently outputs the player index + the number of dice. I've provided a minimal working example below.

Code:
(define "Placement"
    (priority {
        (move Add (piece (id "Disc" Mover)) (to (sites Empty)))
        (move Add (piece (id "Disc" Mover)) (to (sites Occupied by:Mover))
            (then (if (= (count Turns) 10) (set Var "PlacementDone" 1)))
        )
    })
)

//-----------------------------------------------------------------------------------------------------------

(game "TestCode"
    (players 6)
    (equipment {
        (board (square 3)
            largeStack:True
        )
        (piece "Disc" Each)
        (dice num:5)
    })
    (rules
        (play (priority {
            (if (= (var "PlacementDone") -1) "Placement")
        }))
        (end
            (if
                (= (var "PlacementDone") 1)
                (result Next Draw)
            )
        )
    )
)



RE: Trouble using largeStack with dice - Eric Piette - 08-23-2022

Hi,

I found and fixed the issue.

Regards,
Eric