本文整理汇总了Python中galaxySolver.Board.findShapeAroundCell方法的典型用法代码示例。如果您正苦于以下问题:Python Board.findShapeAroundCell方法的具体用法?Python Board.findShapeAroundCell怎么用?Python Board.findShapeAroundCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类galaxySolver.Board
的用法示例。
在下文中一共展示了Board.findShapeAroundCell方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testFindCutConcavShape
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findShapeAroundCell [as 别名]
def testFindCutConcavShape(self):
expected = set()
expected.add((1, 1))
expected.add((1, 3))
expected.add((1, 5))
expected.add((1, 7))
expected.add((3, 7))
expected.add((5, 7))
expected.add((7, 5))
expected.add((7, 3))
expected.add((7, 1))
expected.add((5, 1))
expected.add((3, 1))
expected.add((1, 1))
b = Board(4,4)
b.addWall(2, 3)
b.addWall(2, 5)
b.addWall(3, 6)
b.addWall(5, 6)
b.addWall(6, 5)
b.addWall(6, 3)
b.addWall(5, 2)
b.addWall(3, 2)
b.addWall(7, 6)
b.addWall(6, 7)
self.assertEquals(expected, b.findShapeAroundCell(1, 1, set()))
expected2 = set()
expected2.add((7, 7))
self.assertEquals(expected2, b.findShapeAroundCell(7, 7, set()))
示例2: testMonoCellShape
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findShapeAroundCell [as 别名]
def testMonoCellShape(self):
expected = set()
expected.add((1, 1))
b = Board(2,2)
b.addWall(1, 2)
b.addWall(2, 1)
self.assertEquals(expected, b.findShapeAroundCell(1, 1, set()))
示例3: testShapeInEmptyBoard
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findShapeAroundCell [as 别名]
def testShapeInEmptyBoard(self):
expected = set()
expected.add((1, 1))
expected.add((1, 3))
expected.add((3, 1))
expected.add((3, 3))
b = Board(2,2)
self.assertEquals(expected, b.findShapeAroundCell(1, 1, set()))
示例4: testFindComplexShape
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findShapeAroundCell [as 别名]
def testFindComplexShape(self):
expected = set()
expected.add((1, 1))
expected.add((1, 3))
expected.add((1, 5))
expected.add((1, 7))
b = Board(4,4)
b.addWall(2, 1)
b.addWall(2, 3)
b.addWall(2, 5)
b.addWall(2, 7)
self.assertEquals(expected, b.findShapeAroundCell(1, 1, set()))