Ludii Forum
Dynamical maps - Printable Version

+- Ludii Forum (
+-- Forum: Suggestions (
+--- Forum: Ludii Features / Services (
+--- Thread: Dynamical maps (/showthread.php?tid=1016)

Dynamical maps - Michael - 06-15-2022

Since (var) is basically a string–int pair, and (values Remembered) is a string–intarray pair, could we expand these so we can use integers as the keys? That would be really helpful, I think. Like this:

(remember Value ([<string>] | [<int>]) <int> [unique:<boolean>] [<then>])
(values Remembered ([<string>] | [<int>]))
(forget Value ([<string>] | [<int>]) All [<then>])
(var ([<string>] | [<int>]))
(set Var ([<string>] | [<int>]) [<int>] [<then>])

Or.. should I just do this?:

(define "ToString" "#1")

RE: Dynamical maps - Eric Piette - 06-17-2022

For integer as keys, you can use a map.

RE: Dynamical maps - Michael - 06-17-2022

The reason I specifically asked about dynamical maps is that the maps we have now are equipment. They are immutable and created before the game starts. But I guess I can use the ToString define to acheive the wanted functionality.

RE: Dynamical maps - Eric Piette - 06-22-2022

I do not think the (var ...) ludeme or the (remember ...) ludeme should be able to use integer keys.
Because if we allow this, that means it would be easily possible to create games with no meaning in the description.
Except if you have a concrete case which can not be described easily without these modifications.