476
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
def urbanmain() = {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
import M4._
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
val b2 = Board(Set(King(2, Red, (4,2)), King(2, Wht, (7,1)),
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
Pawn(3, Red, (6,1)), Pawn(2, Wht, (8,4)),
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
Pawn(4, Red, (4,4)), Pawn(2, Wht, (4,1)),
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
Pawn(4, Red, (5,3)), Pawn(3, Wht, (8,7)),
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
Pawn(3, Red, (6,5))))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
assert(protectedN(Pawn(2, Wht, (8,4)), b2) == 1)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
11 |
assert(protectedN(Pawn(4, Red, (5,3)), b2) == 3)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
12 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
}
|