(note (values Remembered)) - 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: (note (values Remembered)) (/showthread.php?tid=1699) |
(note (values Remembered)) - dale walton - 11-01-2023 The note ludeme throws an error when used to report a (values remembered) - possibly because the remembered values included duplicates Selected illegal move: [[SetVar:name=LS,value=7], [Copy:typeFrom=Cell,from=22,levelFrom=0,typeTo=Vertex,to=1,decision=true], [SetState:type=Vertex,to=1,state=7], [RememberValue:name=Captured,value=7], [RememberValue:name=Captured,value=7], [Remove:type=Vertex,to=4], [SetVar:name=PairScore,value=2], [SetVar:name=ToScore,value=3], [Note:message=P2 [I@42486984,to=1], [Note:message=P2 [I@42486984,to=2], [SetScore:player=2,score=3,add=true], [Note:message=P2 3,to=1], [Note:message=P2 3,to=2], [ForgetValue:name=Captured,value=7], [ForgetValue:name=Captured,value=7], [ForgetValue:name=Captured,value=7], [ForgetValue:name=Captured,value=7]] ("UpdateScore" (mover) (values Remembered "Captured")) (define "UpdateScore" (and (note player:(mover) #2) // <<<<------ This threw the error. It was OK with (sites (values Remembered "Captured")) - but showed only one value {7} (values Remembered "Captured") was {7 7} (if (< 0 (var "ToScore")) (and (addScore (player #1) (var "ToScore")) (note player:#1 (var "ToScore")) )))) I was trying to notify the players of the basis for scoring points cribbage style due to the removal of pieces from the board of a strategy game. |