diff -r b37052895281 -r 37b1bfcdba79 marking3/bf1c_test.scala --- a/marking3/bf1c_test.scala Fri Jan 19 14:09:08 2018 +0000 +++ b/marking3/bf1c_test.scala Fri Feb 23 22:26:42 2018 +0000 @@ -4,6 +4,14 @@ assert(start("[-]", Map(0 -> 100)) == Map(0 -> 0)) assert(start("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) assert(start("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) -assert(start("""++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<] - <-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""", Map()) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) + +val hello = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---. + +++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" +assert(start(hello, Map()) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) + assert(start("+++++[->++++++++++<]>--<+++[->>++++++++++<<]>>++<<----------[+>.>.<+<]", Map()) == Map(0 -> 0, 1 -> 58, 2 -> 32)) + +val hello2 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.!!!!!!!!!""" + +assert(start(hello2, Map()) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) +