marking1/collatz_test2.scala
author Christian Urban <urbanc@in.tum.de>
Tue, 04 Feb 2020 14:15:42 +0000
changeset 331 e3878cdd38bc
parent 281 87b9e3e2c1a7
permissions -rw-r--r--
updated

//def myassert(cond : => Boolean) = {
//  try {
//    assert(cond)
//  } catch { 
//    case _ : Throwable => System.exit(1)
//  }
//}

assert(CW6a.collatz_max(10) == (19, 9))
assert(CW6a.collatz_max(100) == (118, 97))
assert(CW6a.collatz_max(1000) == (178, 871))
assert(CW6a.collatz_max(10000) == (261, 6171))
assert(CW6a.collatz_max(100000) == (350, 77031))
assert(CW6a.collatz_max(1000000) == (524, 837799))
assert(CW6a.collatz_max(2) == (1, 2))
assert(CW6a.collatz_max(77000) == (339, 52527))