05-15-2022, 06:55 PM
It is apparently legal to define a map as a list of integer–string pairs, like this: (map "ToString" {(pair 1 "Cat") (pair 2 "Dog")}). So one would think (map "ToString" 1) evaluated to "Cat". But it doesn't..
As far as I can tell, there are no functions in the Ludii grammar that returns a string. Why is this?
(What I really want is a way to associate a value to a site in a way that does not follow the pieces. As far as I understand, the way (state) works now is that the state of a site can be changed if a piece moves from the site, even though (set State) has not been called, because the state is really associated with the piece, not the site. I started thinking about strings because I tried to do this with variables.)
As far as I can tell, there are no functions in the Ludii grammar that returns a string. Why is this?
(What I really want is a way to associate a value to a site in a way that does not follow the pieces. As far as I understand, the way (state) works now is that the state of a site can be changed if a piece moves from the site, even though (set State) has not been called, because the state is really associated with the piece, not the site. I started thinking about strings because I tried to do this with variables.)