main_testing5/bf_test3.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 25 Jan 2021 00:21:00 +0000
changeset 389 4113d4d8cf62
parent 348 b5b6ed38c2f2
child 404 bf20a9fa5c29
permissions -rw-r--r--
updated marking 2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
286
5c57c407e27b updated
Christian Urban <urbanc@in.tum.de>
parents: 243
diff changeset
     1
import CW10a._
235
c989f50da5de updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
243
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     3
assert(jumpRight("[xxxxxx]xxx", 1, 0) == 8)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     4
assert(jumpRight("[xx[x]x]xxx", 1, 0) == 8)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     5
assert(jumpRight("[xx[x]x]xxx", 1, 0) == 8)  
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     6
assert(jumpRight("[xx[xxx]xxx", 1, 0) == 11)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     7
assert(jumpRight("[x[][]x]xxx", 1, 0) == 8)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     8
assert(jumpLeft("[xxxxxx]xxx", 6, 0) == 1)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
     9
assert(jumpLeft("[xxxxxx]xxx", 7, 0) == -1)
9bb36426c781 updated
Christian Urban <urbanc@in.tum.de>
parents: 236
diff changeset
    10
assert(jumpLeft("[x[][]x]xxx", 6, 0) == 1)