marking3/bf1c_test.scala
changeset 168 03530cb87cd0
child 170 37b1bfcdba79
equal deleted inserted replaced
167:349d706586ef 168:03530cb87cd0
       
     1 
       
     2 import CW8b._
       
     3 
       
     4 assert(start("[-]", Map(0 -> 100)) == Map(0 -> 0))
       
     5 assert(start("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10))
       
     6 assert(start("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42))
       
     7 assert(start("""++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]
       
     8 	     <-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""", Map()) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87))
       
     9 assert(start("+++++[->++++++++++<]>--<+++[->>++++++++++<<]>>++<<----------[+>.>.<+<]", Map()) == Map(0 -> 0, 1 -> 58, 2 -> 32))