marking3/marking2/knight2a_test.scala
author Christian Urban <urbanc@in.tum.de>
Sat, 02 Feb 2019 13:28:05 +0000
changeset 261 8997430d9765
parent 227 b5f3e814a710
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)