Shortest way to define a 2D Map
Posted: 22 Jan 2024, 03:19
I can define a 2D object as:
oGrid := {1:{1:1,2:2,3:3},
2:{1:4,2:5,3:6},
3:{1:7,2:8,3:9}}
and, I can define a 2D array as:
aGrid := [[1,2,3],
[4,5,6],
[7,8,9]]
Is there a shorter way to define a 2D map than:
mGrid := Map(1,Map(1,1, 2,2, 3,3),
2,Map(1,4, 2,5, 3,6),
3,Map(1,7, 2,8, 3,9))
Lexios and other posts in "Map shorthand" viewtopic.php?f=37&t=67213&p=299127&hilit=map+definition#p299127 suggests that there may not be a shorter way to define the 2D Map mGrid.
oGrid := {1:{1:1,2:2,3:3},
2:{1:4,2:5,3:6},
3:{1:7,2:8,3:9}}
and, I can define a 2D array as:
aGrid := [[1,2,3],
[4,5,6],
[7,8,9]]
Is there a shorter way to define a 2D map than:
mGrid := Map(1,Map(1,1, 2,2, 3,3),
2,Map(1,4, 2,5, 3,6),
3,Map(1,7, 2,8, 3,9))
Lexios and other posts in "Map shorthand" viewtopic.php?f=37&t=67213&p=299127&hilit=map+definition#p299127 suggests that there may not be a shorter way to define the 2D Map mGrid.