Create a two-dimensional array at runtime: Difference between revisions

→‎{{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, [0] * ynull)
for (i in 0...x) a[i] = List.filled(y, 0)
// write an element
a[x - 1][y - 1] = 42
9,479

edits