Ludii Forum
Add count not working - 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: Add count not working (/showthread.php?tid=186)



Add count not working - AlekErickson - 09-22-2020

Hi, I have tried out the new feature where you can set how many pieces come into play with the Add command. 
It actually runs and compiles but this feature does not work. 
Please take a look when there is time.



(game "Tumbleweed" (players 2)(equipment {(board (hex 5)) (piece "Disc" Each)})
(rules
(start (place Random {"Disc1" "Disc2"}))

(play (move Add (to ( forEach (sites Board) 
if:( and ((> (count Pieces Mover in:(sites LineOfSight at:(to))) 0)    
(> (count Pieces Mover in:(sites LineOfSight at:(to))) (count at:(to)))))))
count:(count Pieces Mover in:(sites LineOfSight at:(to)))
stack:true ))

(end (if (no Moves Next) (byScore {(score P1 (count sites in:(sites Occupied by:P1))) (score P2 (count sites in:(sites Occupied by:P2)))})))))