nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: GitHub API: handles comments
[nit.git]
/
tests
/
shootout_binarytrees.nit
diff --git
a/tests/shootout_binarytrees.nit
b/tests/shootout_binarytrees.nit
index
5416e6a
..
a171b58
100644
(file)
--- a/
tests/shootout_binarytrees.nit
+++ b/
tests/shootout_binarytrees.nit
@@
-20,9
+20,9
@@
# contributed by Jean Privat
class TreeNode
# contributed by Jean Privat
class TreeNode
- attr _left: nullable TreeNode
- attr _right: nullable TreeNode
- attr _item: Int
+ var left: nullable TreeNode
+ var right: nullable TreeNode
+ var item: Int
init(left: nullable TreeNode, right: nullable TreeNode, item: Int)
init(left: nullable TreeNode, right: nullable TreeNode, item: Int)
@@
-33,7
+33,7
@@
class TreeNode
end
end
- meth item_check: Int
+ fun item_check: Int
do
if _left == null then
return _item
do
if _left == null then
return _item
@@
-43,7
+43,7
@@
class TreeNode
end
end
end
end
-meth bottom_up_tree(item: Int, depth: Int): TreeNode
+fun bottom_up_tree(item: Int, depth: Int): TreeNode
do
if depth > 0 then
var item_item = 2 * item
do
if depth > 0 then
var item_item = 2 * item