marking2/knight2a_test.scala
author Christian Urban <urbanc@in.tum.de>
Mon, 15 Jan 2018 23:15:34 +0000
changeset 167 349d706586ef
parent 162 6d25ccbb3cf2
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
162
6d25ccbb3cf2 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
6d25ccbb3cf2 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
val f = (x:(Int, Int)) => if (x._1 > 3) Some(List(x)) else None
6d25ccbb3cf2 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
6d25ccbb3cf2 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
assert(CW7b.first(List((1,0),(2,0),(3,0),(4,0)), f) == Some(List((4,0))))
6d25ccbb3cf2 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
assert(CW7b.first(List((1,0),(2,0),(3,0)), f) == None)