marking/knight3a_test.scala
author Christian Urban <urbanc@in.tum.de>
Fri, 16 Aug 2019 06:51:06 +0100
changeset 276 52faee6d0be2
parent 86 f8a781322499
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
86
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
import scala.concurrent._
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
import scala.concurrent.duration._
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
import ExecutionContext.Implicits.global
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
import scala.language.postfixOps 
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
lazy val f = Future {
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
assert( ordered_moves(8, List((3,4), (3,2)), (1, 3)) == List((0,1), (0,5), (2,1), (2,5)))
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
assert( ordered_moves(8, List((4,0)), (0,0)) == List((2,1), (1,2)))
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
assert( ordered_moves(8, List((0,4)), (0,0)) == List((1,2), (2,1)))
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
}
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
f8a781322499 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
Await.result(f, 120 second)