| author | Christian Urban <christian dot urban at kcl dot ac dot uk> | 
| Mon, 05 Aug 2019 20:14:06 +0100 | |
| changeset 269 | 3ef2542207c4 | 
| parent 267 | 10a2ef26a92c | 
| child 281 | 32dfd2ca577b | 
| permissions | -rw-r--r-- | 
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 1 | def myassert(cond : => Boolean) = {
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 2 |   try {
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 3 | assert(cond) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 4 |   } catch { 
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 5 | case _ : Throwable => System.exit(1) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 6 | } | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 7 | } | 
| 158 | 8 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 9 | myassert(collatz_max(10) == (19, 9)) | 
| 158 | 10 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 11 | myassert(collatz_max(100) == (118, 97)) | 
| 158 | 12 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 13 | myassert(collatz_max(1000) == (178, 871)) | 
| 158 | 14 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 15 | myassert(collatz_max(10000) == (261, 6171)) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 16 | |
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 17 | myassert(collatz_max(100000) == (350, 77031)) | 
| 158 | 18 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 19 | myassert(collatz_max(1000000) == (524, 837799)) | 
| 158 | 20 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 21 | myassert(collatz_max(2) == (1, 2)) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 22 | |
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
212diff
changeset | 23 | myassert(collatz_max(77000) == (339, 52527)) |