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 withi
rows andj
columns(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 rowi
and columnj
of a matrixm
(matrix-set! m i j v)
- set the value stored in the matrix at rowi
and columnj
of matrixm
to a new valuev
(matrix-generator i j proc)
- generate ani
xj
matrix by calling the functionproc
of the form(i j -> value)
at each rowi
and columnj
in 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).