progs/collatz_sol.scala
changeset 64 d6f97b562424
parent 24 66b97f9a40f8
child 123 556cd74cbba9
equal deleted inserted replaced
63:d325bce7b692 64:d6f97b562424
    34   (all.indexOf(max) + 1, max)
    34   (all.indexOf(max) + 1, max)
    35 }
    35 }
    36 
    36 
    37 
    37 
    38 // some testing harness
    38 // some testing harness
    39 val bnds = List(10, 100, 1000, 10000, 100000, 1000000)
    39 val bnds = List(2, 10, 100, 1000, 10000, 100000, 77000, 90000, 1000000)
    40 
    40 
    41 for (bnd <- bnds) {
    41 for (bnd <- bnds) {
    42   val (max, steps) = collatz_max(bnd)
    42   val (max, steps) = collatz_max(bnd)
    43   println(s"In the range of 1 - ${bnd} the number ${max} needs the maximum steps of ${steps}")
    43   println(s"In the range of 1 - ${bnd} the number ${max} needs the maximum steps of ${steps}")
    44 }
    44 }