main_testing5/bf_test3.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 13 Jun 2024 13:13:33 +0100
changeset 491 e2ffe8642f55
parent 475 59e005dcf163
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
475
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     1
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     2
def urbanmain() = {
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     3
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     4
  import M5a._
235
c989f50da5de updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
475
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     6
  assert(jumpRight("[xxxxxx]xxx", 1, 0) == 8)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     7
  assert(jumpRight("[xx[x]x]xxx", 1, 0) == 8)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     8
  assert(jumpRight("[xx[x]x]xxx", 1, 0) == 8)  
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
     9
  assert(jumpRight("[xx[xxx]xxx", 1, 0) == 11)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
    10
  assert(jumpRight("[x[][]x]xxx", 1, 0) == 8)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
    11
  assert(jumpLeft("[xxxxxx]xxx", 6, 0) == 1)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
    12
  assert(jumpLeft("[xxxxxx]xxx", 7, 0) == -1)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
    13
  assert(jumpLeft("[x[][]x]xxx", 6, 0) == 1)
59e005dcf163 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 404
diff changeset
    14
}