marking3/marking2/knight2a_test.scala
author Christian Urban <urbanc@in.tum.de>
Wed, 07 Aug 2019 14:32:21 +0100
changeset 272 a091de62e3f8
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)