示例#1
0
 def test_capture_is_not_suicide(self):
     board = Board(19, 19)
     board.place_stone(Player.black, Point(1, 1))
     board.place_stone(Player.black, Point(2, 2))
     board.place_stone(Player.black, Point(1, 3))
     board.place_stone(Player.white, Point(2, 1))
     board.place_stone(Player.white, Point(1, 2))
     self.assertIsNone(board.get(Point(1, 1)))
     self.assertEqual(Player.white, board.get(Point(2, 1)))
     self.assertEqual(Player.white, board.get(Point(1, 2)))
示例#2
0
 def test_capture_two_stones(self):
     board = Board(19, 19)
     board.place_stone(Player.black, Point(2, 2))
     board.place_stone(Player.black, Point(2, 3))
     board.place_stone(Player.white, Point(1, 2))
     board.place_stone(Player.white, Point(1, 3))
     self.assertEqual(Player.black, board.get(Point(2, 2)))
     self.assertEqual(Player.black, board.get(Point(2, 3)))
     board.place_stone(Player.white, Point(3, 2))
     board.place_stone(Player.white, Point(3, 3))
     self.assertEqual(Player.black, board.get(Point(2, 2)))
     self.assertEqual(Player.black, board.get(Point(2, 3)))
     board.place_stone(Player.white, Point(2, 1))
     board.place_stone(Player.white, Point(2, 4))
     self.assertIsNone(board.get(Point(2, 2)))
     self.assertIsNone(board.get(Point(2, 3)))