本文整理汇总了Python中go.EMPTY_BOARD属性的典型用法代码示例。如果您正苦于以下问题:Python go.EMPTY_BOARD属性的具体用法?Python go.EMPTY_BOARD怎么用?Python go.EMPTY_BOARD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类go
的用法示例。
在下文中一共展示了go.EMPTY_BOARD属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_load_board
# 需要导入模块: import go [as 别名]
# 或者: from go import EMPTY_BOARD [as 别名]
def test_load_board(self):
self.assertEqualNPArray(go.EMPTY_BOARD, np.zeros([go.N, go.N]))
self.assertEqualNPArray(
go.EMPTY_BOARD, test_utils.load_board('. \n' * go.N ** 2))
示例2: test_neighbors
# 需要导入模块: import go [as 别名]
# 或者: from go import EMPTY_BOARD [as 别名]
def test_neighbors(self):
corner = coords.from_kgs('A1')
neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[corner]]
self.assertEqual(len(neighbors), 2)
side = coords.from_kgs('A2')
side_neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[side]]
self.assertEqual(len(side_neighbors), 3)
示例3: test_load_board
# 需要导入模块: import go [as 别名]
# 或者: from go import EMPTY_BOARD [as 别名]
def test_load_board(self):
self.assertEqualNPArray(go.EMPTY_BOARD, np.zeros([go.N, go.N]))
self.assertEqualNPArray(go.EMPTY_BOARD, load_board('. \n' * go.N ** 2))
示例4: test_neighbors
# 需要导入模块: import go [as 别名]
# 或者: from go import EMPTY_BOARD [as 别名]
def test_neighbors(self):
corner = pc('A1')
neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[corner]]
self.assertEqual(len(neighbors), 2)
side = pc('A2')
side_neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[side]]
self.assertEqual(len(side_neighbors), 3)
示例5: test_neighbors
# 需要导入模块: import go [as 别名]
# 或者: from go import EMPTY_BOARD [as 别名]
def test_neighbors(self):
corner = coords.from_gtp('A1')
neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[corner]]
self.assertEqual(len(neighbors), 2)
side = coords.from_gtp('A2')
side_neighbors = [go.EMPTY_BOARD[c] for c in go.NEIGHBORS[side]]
self.assertEqual(len(side_neighbors), 3)