marking3/marking2/knight2a_test.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 06 Dec 2018 15:15:31 +0000
changeset 231 26b5a843c696
parent 227 37e659cfbb2e
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
162
2ea5b3456ed7 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
2ea5b3456ed7 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
2ea5b3456ed7 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
2ea5b3456ed7 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))))
2ea5b3456ed7 marking 2
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
assert(CW7b.first(List((1,0),(2,0),(3,0)), f) == None)