marking2/knight2a_test.scala
author Christian Urban <urbanc@in.tum.de>
Fri, 05 Oct 2018 11:23:15 +0100
changeset 192 cd2a9c969ef2
parent 162 2ea5b3456ed7
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)