class Matrice
# A matrice of integers
- meth [](x: Int, y: Int): Int
+ fun [](x: Int, y: Int): Int
# The integer at (x,y)
do
return _tab[x][y]
end
- meth []=(x: Int, y: Int, v: Int)
+ fun []=(x: Int, y: Int, v: Int)
# Put v in (x, y)
do
# Buld more arrays if needed
end
private
- attr _tab: Array[Array[Int]] # An array of array to store items
+ var _tab: Array[Array[Int]] # An array of array to store items
init
m[1,1] = 11
m[2,1] = 21
m[5,5] = 55
-printn(m[1,1])
-printn(m[2,1])
-printn(m[5,5])
+print(m[1,1])
+print(m[2,1])
+print(m[5,5])