本文整理汇总了Python中galaxySolver.Board.findOuterWalls方法的典型用法代码示例。如果您正苦于以下问题:Python Board.findOuterWalls方法的具体用法?Python Board.findOuterWalls怎么用?Python Board.findOuterWalls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类galaxySolver.Board
的用法示例。
在下文中一共展示了Board.findOuterWalls方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testOuterShapeConcav
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeConcav(self):
b = Board(4, 4)
cells = set()
cells.add((1, 1))
cells.add((1, 3))
cells.add((1, 5))
cells.add((1, 7))
cells.add((3, 1))
cells.add((3, 7))
cells.add((5, 1))
cells.add((5, 7))
cells.add((7, 1))
cells.add((7, 3))
cells.add((7, 5))
cells.add((7, 7))
b.addWall(2, 3)
b.addWall(2, 5)
b.addWall(3, 2)
b.addWall(3, 6)
b.addWall(5, 2)
b.addWall(5, 6)
b.addWall(6, 3)
b.addWall(6, 5)
walls = set()
walls.add((2, 3))
walls.add((2, 5))
walls.add((3, 2))
walls.add((3, 6))
walls.add((5, 2))
walls.add((5, 6))
walls.add((6, 3))
walls.add((6, 5))
walls.add((0, 1))
walls.add((0, 3))
walls.add((0, 5))
walls.add((0, 7))
walls.add((1, 0))
walls.add((1, 8))
walls.add((3, 0))
walls.add((3, 8))
walls.add((5, 0))
walls.add((5, 8))
walls.add((7, 0))
walls.add((7, 8))
walls.add((8, 1))
walls.add((8, 3))
walls.add((8, 5))
walls.add((8, 7))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)
示例2: testOuterShapeSimple
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeSimple(self):
b = Board(4, 4)
cells = set()
cells.add((3, 3))
cells.add((3, 5))
cells.add((5, 3))
cells.add((5, 5))
b.addWall(2, 3)
b.addWall(2, 5)
b.addWall(3, 2)
b.addWall(3, 6)
b.addWall(5, 2)
b.addWall(5, 6)
b.addWall(6, 3)
b.addWall(6, 5)
walls = set()
walls.add((2, 3))
walls.add((2, 5))
walls.add((3, 2))
walls.add((3, 6))
walls.add((5, 2))
walls.add((5, 6))
walls.add((6, 3))
walls.add((6, 5))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)
示例3: testOuterShapeSingleCell
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeSingleCell(self):
b = Board(4, 4)
cells = set()
cells.add((3, 3))
b.addWall(2, 3)
b.addWall(3, 2)
b.addWall(3, 4)
b.addWall(4, 3)
walls = set()
walls.add((2, 3))
walls.add((3, 2))
walls.add((3, 4))
walls.add((4, 3))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)
示例4: testOuterShapeEmptyBoard
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeEmptyBoard(self):
b = Board(2, 2)
cells = set()
cells.add((1, 1))
cells.add((1, 3))
cells.add((3, 1))
cells.add((3, 3))
walls = set()
walls.add((0, 1))
walls.add((0, 3))
walls.add((1, 0))
walls.add((1, 4))
walls.add((3, 0))
walls.add((3, 4))
walls.add((4, 1))
walls.add((4, 3))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)
示例5: testOuterShapeEmptyBoardDumbWall
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeEmptyBoardDumbWall(self):
b = Board(2, 2)
cells = set()
cells.add((1, 1))
cells.add((1, 3))
cells.add((3, 1))
cells.add((3, 3))
b.addWall(1, 2) # A wall that doesn't frontier the shape
walls = set()
walls.add((0, 1))
walls.add((0, 3))
walls.add((1, 0))
walls.add((1, 4))
walls.add((3, 0))
walls.add((3, 4))
walls.add((4, 1))
walls.add((4, 3))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)
示例6: testOuterShapeEmptyBoardFrontieringShape
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import findOuterWalls [as 别名]
def testOuterShapeEmptyBoardFrontieringShape(self):
b = Board(2, 2)
cells = set()
cells.add((1, 1))
cells.add((1, 3))
cells.add((3, 1))
cells.add((3, 3))
b.addWall(1, 2) # 2 walls that make another shape near the first one
b.addWall(2, 3)
walls = set()
walls.add((0, 1))
walls.add((0, 3))
walls.add((1, 0))
walls.add((1, 4))
walls.add((3, 0))
walls.add((3, 4))
walls.add((4, 1))
walls.add((4, 3))
resultWalls = b.findOuterWalls(cells)
self.assertEquals(walls, resultWalls)