marking3/knight1_test4.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 02 Nov 2023 11:32:10 +0000
changeset 472 6a77c260c8a5
parent 331 e3878cdd38bc
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
331
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 244
diff changeset
     1
import CW8a._
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
331
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 244
diff changeset
     4
val f_urban = (x:(Int, Int)) => if (x._1 > 3) Some(List(x)) else None
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 244
diff changeset
     5
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 244
diff changeset
     6
assert(first(List((1,0),(2,0),(3,0),(4,0)), f_urban) == Some(List((4,0))))
e3878cdd38bc updated
Christian Urban <urbanc@in.tum.de>
parents: 244
diff changeset
     7
assert(first(List((1,0),(2,0),(3,0)), f_urban) == None)