equal
deleted
inserted
replaced
1 import M5a._ |
1 import M5a._ |
|
2 |
|
3 |
|
4 import scala.concurrent._ |
|
5 import scala.concurrent.duration._ |
|
6 import ExecutionContext.Implicits.global |
|
7 import scala.language.postfixOps |
|
8 |
|
9 lazy val f = Future { |
2 |
10 |
3 assert(run("[-]", Map(0 -> 100)) == Map(0 -> 0)) |
11 assert(run("[-]", Map(0 -> 100)) == Map(0 -> 0)) |
4 assert(run("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) |
12 assert(run("[->+<]", Map(0 -> 10)) == Map(0 -> 0, 1 -> 10)) |
5 assert(run("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) |
13 assert(run("[>>+>>+<<<<-]", Map(0 -> 42)) == Map(0 -> 0, 2 -> 42, 4 -> 42)) |
6 |
14 |
11 |
19 |
12 val hw_urban1 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---. |
20 val hw_urban1 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---. |
13 +++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
21 +++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
14 |
22 |
15 assert(run(hw_urban1) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) |
23 assert(run(hw_urban1) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) |
|
24 |
|
25 } |
|
26 |
|
27 Await.result(f, 32 second) |
|
28 |