Logo

Programming-Idioms

History of Idiom 26 > diff from v34 to v35

Edit summary for version 35 by Dodopod:
New Scheme implementation by user [Dodopod]

Version 34

2016-11-04, 23:06:42

Version 35

2017-06-13, 15:50:52

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration
Code
(build-list m (lambda (x)
                (build-list n (lambda (y) 0))))
Comments bubble
The (lambda (y) 0) isn't strictly necessary, it just initializes the values in the matrix to 0.