Esempio n. 1
0
    def test_boundries(self):        
        board = Hive()
        piece = Spider(Color.WHITE)
        board.add(piece, HCP(0,0))

        # Note that these are in the hive coordinate system.
        open_locations = [HCP(1,0), HCP(0,1), HCP(-1,0),
                          HCP(0,-1), HCP(1,-1), HCP(-1,1)]

        self.assertEqual(set(board.edge()),set(open_locations))
Esempio n. 2
0
    def test_two_piece(self):
        board = Hive()
        piece1 = Spider(Color.WHITE)
        piece2 = Spider(Color.WHITE)
        board.add(piece1, HCP(0,0))
        board.add(piece2, HCP(1,0))

        open_locations = [HCP(1,1), HCP(0,1), HCP(-1,0),
                          HCP(0,-1), HCP(1,-1), HCP(-1,1),
                          HCP(2,0), HCP(2,-1)]

        self.assertEqual(set(board.edge()), set(open_locations))