core_marking1/collatz_test3.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 26 Apr 2024 17:35:36 +0100
changeset 486 9c03b5e89a2a
parent 463 0315d9983cd0
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
463
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
     1
import scala.concurrent._
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
     2
import scala.concurrent.duration._
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
     3
import ExecutionContext.Implicits.global
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
     4
import scala.language.postfixOps 
373
d29cd5883c7b updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
463
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
     6
lazy val f = Future {
424
Christian Urban <christian.urban@kcl.ac.uk>
parents: 373
diff changeset
     7
assert(C1.last_odd(113) == 85)
Christian Urban <christian.urban@kcl.ac.uk>
parents: 373
diff changeset
     8
assert(C1.last_odd(84) == 21)
Christian Urban <christian.urban@kcl.ac.uk>
parents: 373
diff changeset
     9
assert(C1.last_odd(605) == 341)
463
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    10
}
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    11
0315d9983cd0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    12
Await.result(f, 32 second)