equal
deleted
inserted
replaced
1 import M5b._ |
1 import M5b._ |
2 |
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 { |
3 val hw_urban = """+++++[->++++++++++<]>--<+++[->>++++++++++<<]>>++<<----------[+>.>.<+<]""" |
10 val hw_urban = """+++++[->++++++++++<]>--<+++[->>++++++++++<<]>>++<<----------[+>.>.<+<]""" |
4 assert(jtable(hw_urban) == Map(69 -> 61, 5 -> 20, 60 -> 70, 27 -> 44, 43 -> 28, 19 -> 6)) |
11 assert(jtable(hw_urban) == Map(69 -> 61, 5 -> 20, 60 -> 70, 27 -> 44, 43 -> 28, 19 -> 6)) |
5 |
12 |
6 val hw_urban1 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
13 val hw_urban1 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
7 |
14 |
18 |
25 |
19 val hw_urban3 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---. |
26 val hw_urban3 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---. |
20 +++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
27 +++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.""" |
21 |
28 |
22 assert(run2(hw_urban3) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) |
29 assert(run2(hw_urban3) == Map(0 -> 0, 5 -> 33, 1 -> 0, 6 -> 10, 2 -> 72, 3 -> 100, 4 -> 87)) |
|
30 |
|
31 } |
|
32 |
|
33 Await.result(f, 32 second) |
|
34 |