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

Content added Content deleted
m (→‎{{header|Icon and Unicon}}: Don't use header like this)
(Added PicoLisp)
Line 641: Line 641:
> 0 1 0
> 0 1 0
> 0 0 0</lang>
> 0 0 0</lang>

=={{header|PicoLisp}}==
<lang PicoLisp>(de 2dimTest (DX DY)
(let A (make (do DX (link (need DY))))
(set (nth A 3 3) 999) # Set A[3][3] to 999
(mapc println A) # Print all
(get A 3 3) ) ) # Return A[3][3]</lang>
Output:
<pre>(NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL)
(NIL NIL 999 NIL NIL)
(NIL NIL NIL NIL NIL)
(NIL NIL NIL NIL NIL)
-> 999</pre>


=={{header|PL/I}}==
=={{header|PL/I}}==