Ejemplo n.º 1
0
 def test_size_2(self):
     goboard = GoBoard(2)
     self.assertEqual(goboard.size, 2)
     self.assertEqual(goboard.NS, 3)
     self.assertEqual(goboard.WE, 1)
     self.assertEqual(goboard.ko_recapture, None)
     self.assertEqual(goboard.current_player, BLACK)
     self.assertEqual(goboard.maxpoint, 13)
     self.assertEqual(goboard.board[0], BORDER)
     self.assertEqual(goboard.board[goboard.pt(1, 1)], EMPTY)
     self.assertEqual(goboard.board[goboard.pt(1, 2)], EMPTY)
     self.assertEqual(goboard.board[goboard.pt(2, 1)], EMPTY)
     self.assertEqual(goboard.board[goboard.pt(2, 2)], EMPTY)
Ejemplo n.º 2
0
 def test_size_2_legal_moves(self):
     size = 2
     goboard = GoBoard(size)
     moves = GoBoardUtil.generate_legal_moves(goboard, BLACK)
     self.assertEqual(
         moves,
         [
             goboard.pt(1, 1),
             goboard.pt(1, 2),
             goboard.pt(2, 1),
             goboard.pt(2, 2)
         ],
     )
Ejemplo n.º 3
0
 def test_size_2_play_move(self):
     size = 2
     goboard = GoBoard(size)
     goboard.play_move(goboard.pt(1, 1), BLACK)
     count = count_colors(goboard)
     self.assertEqual(count, [size * size - 1, 1, 0, 3 * (size + 1)])