| author | Christian Urban <urbanc@in.tum.de> | 
| Wed, 24 Jul 2019 15:18:44 +0100 | |
| changeset 267 | 10a2ef26a92c | 
| parent 266 | 31e5218f43de | 
| child 281 | 32dfd2ca577b | 
| permissions | -rw-r--r-- | 
| 158 | 1 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 2 | def myassert(cond : => Boolean) = {
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 3 |   try {
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 4 | assert(cond) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 5 |   } catch { 
 | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 6 | case _ : Throwable => System.exit(1) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 7 | } | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 8 | } | 
| 158 | 9 | |
| 267 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 10 | myassert(collatz(1) == 0) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 11 | myassert(collatz(6) == 8) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 12 | myassert(collatz(9) == 19) | 
| 
10a2ef26a92c
updated myassert workaround
 Christian Urban <urbanc@in.tum.de> parents: 
266diff
changeset | 13 | myassert(collatz(9000) == 47) | 
| 158 | 14 |