progs/collatz_sol.scala
changeset 140 ecec79b9ab25
parent 127 b4def82f3f9f
equal deleted inserted replaced
139:3350cc06804b 140:ecec79b9ab25
    14   val max = all.max
    14   val max = all.max
    15   (max, all.indexOf(max) + 1)
    15   (max, all.indexOf(max) + 1)
    16 }
    16 }
    17 
    17 
    18 
    18 
    19 // some testing harness...5 Mio pushes the envelope
       
    20 
       
    21 val bnds = List(2, 10, 100, 1000, 10000, 100000, 
       
    22 		77000, 90000, 1000000, 5000000)
       
    23 
       
    24 for (bnd <- bnds) {
       
    25   val (steps, max) = collatz_max(bnd)
       
    26   println(s"In the range of 1 - ${bnd} the number ${max} needs the maximum steps of ${steps}")
       
    27 }
    19 }
    28 
    20 
    29 
       
    30 }
       
    31