nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fannkuch-redux actor example
[nit.git]
/
tests
/
test_operator_brackets.nit
diff --git
a/tests/test_operator_brackets.nit
b/tests/test_operator_brackets.nit
index
4b1a479
..
e00f4d2
100644
(file)
--- a/
tests/test_operator_brackets.nit
+++ b/
tests/test_operator_brackets.nit
@@
-19,13
+19,13
@@
class Matrice
# A matrice of integers
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
# 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
# Put v in (x, y)
do
# Buld more arrays if needed
@@
-48,15
+48,7
@@
class Matrice
row[y] = v
end
row[y] = v
end
-private
- attr _tab: Array[Array[Int]] # An array of array to store items
-
-
- init
- # Build an empty matrice
- do
- _tab = new Array[Array[Int]]
- end
+ private var tab = new Array[Array[Int]] # An array of array to store items
end
end
@@
-66,6
+58,6
@@
var m = new Matrice
m[1,1] = 11
m[2,1] = 21
m[5,5] = 55
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])