main_testing4/shogun_test3.scala
changeset 476 7550c816187a
equal deleted inserted replaced
475:59e005dcf163 476:7550c816187a
       
     1 def urbanmain() = {
       
     2   import M4._
       
     3 
       
     4   val b_init = Board(Set(King(2,Wht,(4,1)), King(1,Red,(5,8)),
       
     5                          Pawn(4,Wht,(1,1)), Pawn(4,Red,(1,8)),
       
     6                   	 Pawn(3,Wht,(2,1)), Pawn(2,Red,(2,8)),
       
     7                       	 Pawn(2,Wht,(3,1)), Pawn(3,Red,(3,8)),
       
     8               		 Pawn(1,Wht,(5,1)), Pawn(1,Red,(4,8)),
       
     9                		 Pawn(4,Wht,(6,1)), Pawn(3,Red,(6,8)),
       
    10                		 Pawn(3,Wht,(7,1)), Pawn(1,Red,(7,8)),
       
    11                		 Pawn(2,Wht,(8,1)), Pawn(3,Red,(8,8))))
       
    12 
       
    13   val b2 = Board(Set(King(2, Red, (4,2)), King(2, Wht, (7,1)),
       
    14                      Pawn(3, Red, (6,1)), Pawn(2, Wht, (8,4)),
       
    15                      Pawn(4, Red, (4,4)), Pawn(2, Wht, (4,1)),
       
    16                      Pawn(4, Red, (5,3)), Pawn(3, Wht, (8,7)),
       
    17                      Pawn(3, Red, (6,5))))
       
    18 
       
    19   assert(attacked(Red, b2) == Set(Pawn(2,Wht,(8,4)), King(2,Wht,(7,1))))
       
    20   assert(attacked(Wht, b2) == Set(Pawn(3,Red,(6,1))))
       
    21   assert(attacked(Wht, b_init) == Set())
       
    22   assert(attacked(Red, b_init) == Set())
       
    23 
       
    24 }