373
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
//def myassert(cond : => Boolean) = {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
// try {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
// assert(cond)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
// } catch {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
// case _ : Throwable => System.exit(1)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
// }
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
//}
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
assert(CW6a.collatz_max(10) == (19, 9))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
assert(CW6a.collatz_max(100) == (118, 97))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
11 |
assert(CW6a.collatz_max(1000) == (178, 871))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
12 |
assert(CW6a.collatz_max(10000) == (261, 6171))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
assert(CW6a.collatz_max(100000) == (350, 77031))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
14 |
assert(CW6a.collatz_max(1000000) == (524, 837799))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
15 |
assert(CW6a.collatz_max(2) == (1, 2))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
16 |
assert(CW6a.collatz_max(77000) == (339, 52527))
|