Ejemplo n.º 1
0
 def test_black_pawn_two_steps_not_straight(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, 'pb', None, None],  # 1
         [None, None, None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(1, 1, 3, 3, board)
     self.assertEqual(valid, False)
Ejemplo n.º 2
0
 def test_pawn_two_steps_forward(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, None, None, None],  # 1
         [None, 'pw', None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(2, 1, 0, 1, board)
     self.assertEqual(valid, True)
Ejemplo n.º 3
0
 def test_white_pawn_two_steps_not_straight(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, None, None, None],  # 1
         [None, 'pw', None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(2, 1, 0, 3, board)
     self.assertEqual(valid, False)
Ejemplo n.º 4
0
 def test_white_pawn_backwards(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, None, None, None],  # 1
         [None, 'pw', None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(2, 1, 3, 1, board)
     self.assertEqual(valid, False)
Ejemplo n.º 5
0
 def test_white_attack_friend(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, None, 'pw', None],  # 1
         [None, 'pw', None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(2, 1, 1, 2, board)
     self.assertEqual(valid, False)
Ejemplo n.º 6
0
 def test_white_attack_competitor(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, None, 'pb', None],  # 1
         [None, 'pw', None, None],  # 2
         [None, None, None, None],  # 3
     ]
     valid = pawn(2, 1, 1, 2, board)
     self.assertEqual(valid, True)
Ejemplo n.º 7
0
 def test_black_pawn_two_steps(self):
     board = [
         # 0     1     2     3
         [None, None, None, None],  # 0
         [None, 'pb', None, None],  # 1
         [None, None, None, None],  # 2
         [None, None, None, None],  # 3
         [None, None, None, None],  # 4
         [None, 'hw', None, None],  # 5
     ]
     valid = pawn(1, 1, 3, 1, board)
     self.assertEqual(valid, True)