Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 17:39, 23 July 2020
, 3 years ago→{{header|Wren}}: Fixed a potential bug, though results unaffected.
(Added Wren) |
(→{{header|Wren}}: Fixed a potential bug, though results unaffected.) |
||
Line 2,590:
}
// create the 2d array
var a = List.filled(x,
for (i in 0...x) a[i] = List.filled(y, 0)
// write an element
a[x - 1][y - 1] = 42
|