marking1/collatz_test1.scala
changeset 281 87b9e3e2c1a7
parent 267 9e0216756771
equal deleted inserted replaced
280:a057dc4457fc 281:87b9e3e2c1a7
     1 
     1 
     2 def myassert(cond : => Boolean) = {
       
     3   try {
       
     4     assert(cond)
       
     5   } catch { 
       
     6     case _ : Throwable => System.exit(1)
       
     7   }
       
     8 }
       
     9 
     2 
    10 myassert(collatz(1) == 0)
     3 assert(CW6a.collatz(1) == 0)
    11 myassert(collatz(6) == 8)
     4 assert(CW6a.collatz(6) == 8)
    12 myassert(collatz(9) == 19)
     5 assert(CW6a.collatz(9) == 19)
    13 myassert(collatz(9000) == 47)
     6 assert(CW6a.collatz(9000) == 47)
    14 
     7 
       
     8