parser: regenerate with lambda
[nit.git] / examples / rosettacode / hailstone.nit
index c1351e1..af68297 100644 (file)
@@ -25,7 +25,7 @@ fun hailstone (n: Int): Array[Int]
 do
        var sequence = [n]
        while n != 1 do
-               if n.bin_and(0x01) == 0 then
+               if n & 0x01 == 0 then
                        n = n / 2
                else
                        n = 3 * n + 1
@@ -41,7 +41,7 @@ print "Sequence for 27 has {size27} begin with: {sequence27[0]}, " +
                 "and end with: {sequence27[size27 - 4]}, {sequence27[size27 - 3]}, " +
                 "{sequence27[size27 - 2]}, {sequence27[size27 - 1]}"
 
-var max: Int = hailstone(1).length
+var max = hailstone(1).length
 var max_sequence = hailstone(1)
 var max_element = 1