author | Christian Urban <urbanc@in.tum.de> |
Wed, 30 Oct 2019 12:37:18 +0000 | |
changeset 286 | 5c57c407e27b |
parent 236 | e461b5325b5e |
child 329 | 8a34b2ebc8cc |
permissions | -rw-r--r-- |
286 | 1 |
import CW10a._ |
235 | 2 |
|
236 | 3 |
assert(run("[-]", Map(0 -> 100)) == Map(0 -> 0)) |
4 |
assert(run("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) |
|
5 |
assert(run("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) |
|
6 |
val hw_urban = """+++++[->++++++++++<]>--<+++[->>++++++++++ |
|
7 |
<<]>>++<<----------[+>.>.<+<]""" |
|
8 |
assert(run(hw_urban) == Map(0 -> 0, 1 -> 58, 2 -> 32)) |
|
235 | 9 |