Khan/khan-exercises — pull request #8294 by Sligo (2011-12-10 10:25:43+00:00)
Title: Modified randRange() to allow matrix (two dimensional array) creation.

I just made a few modifications to the randRange() function in math.js to allow it to be used to create two dimensional arrays of random numbers, rather than just the one dimensional arrays that it can currently create. This should be useful for exercises in Linear Algebra requiring the creation of matrices.

It should work exactly the same as before if only three arguments are passed, but in this new version, if a fourth argument is passed, it will create a matrix with a number of columns equal to the third argument, and a number of rows equal to the fourth argument.

I couldn't work out how to get it to work with jquery.map, so I used for loops instead to create the matrix. If it would be better to do it with jquery.map, and you know how to do it, let me know and I'll fix it.

Any suggestions would be appreciated.