For the final exam, I’ve added a matrix API. The students are supposed to have implemented this, but we know that haven’t, so this way they can either use their version or mine.
Matrix API (Edit: The most up to date Matrix API can be found here):
(make-matrix i j)- create a new matrix with
(matrix-rows m)- determine the number of rows in a matrix
(matrix-cols m)- determine the number of columns in a matrix
(matrix-ref m i j)- get the value at row
jof a matrix
(matrix-set! m i j v)- set the value stored in the matrix at row
mto a new value
(matrix-generator i j proc)- generate an
jmatrix by calling the function
procof the form
(i j -> value)at each row
jin the matrix
It’s very similar to the image API and that’s by design. It should be easy enough to convert from one to the other if need be.
1.346.23 is the newest version (and has the matrix API included).