equal
deleted
inserted
replaced
|
1 def myassert(cond : => Boolean) = { |
|
2 try { |
|
3 assert(cond) |
|
4 } catch { |
|
5 case _ : Throwable => System.exit(1) |
|
6 } |
|
7 } |
1 |
8 |
|
9 myassert(collatz_max(10) == (19, 9)) |
2 |
10 |
3 assert(collatz_max(10) == (19, 9)) |
11 myassert(collatz_max(100) == (118, 97)) |
4 |
12 |
5 assert(collatz_max(100) == (118, 97)) |
13 myassert(collatz_max(1000) == (178, 871)) |
6 |
14 |
7 assert(collatz_max(1000) == (178, 871)) |
15 myassert(collatz_max(10000) == (261, 6171)) |
8 |
16 |
9 assert(collatz_max(10000) == (261, 6171)) |
17 myassert(collatz_max(100000) == (350, 77031)) |
10 |
18 |
11 assert(collatz_max(100000) == (350, 77031)) |
19 myassert(collatz_max(1000000) == (524, 837799)) |
12 |
20 |
13 assert(collatz_max(1000000) == (524, 837799)) |
21 myassert(collatz_max(2) == (1, 2)) |
14 |
22 |
15 //assert(collatz_max(2) == (1, 2) || collatz_max(2) == (0, 1)) |
23 myassert(collatz_max(77000) == (339, 52527)) |
16 assert(collatz_max(2) == (1, 2)) |
|
17 assert(collatz_max(77000) == (339, 52527)) |
|