386
|
1 |
import CW8a._
|
384
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
assert(syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+"))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
assert(syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+"))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
assert(syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+"))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
assert(syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/"))
|