You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
380 B

5 years ago
Matrix := Object clone do(
store ::= nil
get := method(x, y,
store at(x) at(y)
)
set := method(x, y, value,
store at(x) atPut(y, value)
)
dim := method(x, y,
list setSize(x) map(list setSize(y))
Matrix clone setStore(
list setSize(x) map(list setSize(y))
)
)
)
m := Matrix dim(10, 7)
m set(3,4, 5)
m get(3,4) println
m get(3,0) println