equal
deleted
inserted
replaced
1 import CW10a._ |
1 import M5a._ |
2 |
2 |
3 assert(run("[-]", Map(0 -> 100)) == Map(0 -> 0)) |
3 assert(run("[-]", Map(0 -> 100)) == Map(0 -> 0)) |
4 assert(run("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) |
4 assert(run("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) |
5 assert(run("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) |
5 assert(run("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) |
6 assert(run("++++++++++#>+***#") == Map(0 -> 10, 1 -> 1000)) |
6 |
7 assert(run("+++>+@+@+@+@+@") == Map(0 -> 3, 1 -> 7, 4 -> 3, 5 -> 3, 6 -> 3, 7 -> 3)) |
|
8 |
7 |
9 val hw_urban = """+++++[->++++++++++<]>--<+++[->>++++++++++ |
8 val hw_urban = """+++++[->++++++++++<]>--<+++[->>++++++++++ |
10 <<]>>++<<----------[+>.>.<+<]""" |
9 <<]>>++<<----------[+>.>.<+<]""" |
11 assert(run(hw_urban) == Map(0 -> 0, 1 -> 58, 2 -> 32)) |
10 assert(run(hw_urban) == Map(0 -> 0, 1 -> 58, 2 -> 32)) |
12 |
11 |