end
end
- var _t: Array[Int] # The stack of discus (only the diameter is stored).
+ var t = new Array[Int] # The stack of discus (only the diameter is stored).
init full(n: Int)
# Build a new tower with `n' discus.
do
assert positive: n >= 0
- _t = new Array[Int].with_capacity(n)
+ t.enlarge(n)
for i in [0..n[ do
push(n-i)
end
init empty
# Build a empty tower.
do
- _t = new Array[Int]
end
end
return "{_tower1} {_tower2} {_tower3}"
end
- var _tower1: Tower
- var _tower2: Tower
- var _tower3: Tower
+ var tower1: Tower
+ var tower2: Tower
+ var tower3: Tower
init(nb: Int)
do