当前位置: 首页>>代码示例>>Python>>正文


Python Board.addDot方法代码示例

本文整理汇总了Python中galaxySolver.Board.addDot方法的典型用法代码示例。如果您正苦于以下问题:Python Board.addDot方法的具体用法?Python Board.addDot怎么用?Python Board.addDot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在galaxySolver.Board的用法示例。


在下文中一共展示了Board.addDot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testdotSeesCellSomeDotsCannotBeBypassedDotOnWall

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testdotSeesCellSomeDotsCannotBeBypassedDotOnWall(self):
     b = Board(4, 4)
     b.addDot(1, 1)
     b.addDot(1, 3)
     b.addDot(3, 2)
     b.addDot(5, 3)
     self.assertFalse(b.dotSeesCell(1, 1, 7, 7))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:9,代码来源:tests.py

示例2: testdotSeesCellSomeDotsCanBeBypassed

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testdotSeesCellSomeDotsCanBeBypassed(self):
     b = Board(4, 4)
     b.addDot(1, 1)
     b.addDot(1, 3)
     b.addDot(3, 3)
     b.addDot(5, 3)
     self.assertTrue(b.dotSeesCell(1, 1, 7, 7))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:9,代码来源:tests.py

示例3: testCellIsFilledByOnlyOneDotOnItsEdge

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testCellIsFilledByOnlyOneDotOnItsEdge(self):
     b = Board(4, 4)
     b.addDot(3, 2)
     self.assertTrue(b.cellContainsDot(2, 2))
     self.assertTrue(b.cellContainsDot(3, 1))
     self.assertTrue(b.cellContainsDot(3, 3))
     self.assertTrue(b.cellContainsDot(4, 1))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:9,代码来源:tests.py

示例4: testCellCanBelongToDotFullCells

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
    def testCellCanBelongToDotFullCells(self):
        b = Board(4, 4)
        b.addDot(1, 2)
        self.assertTrue(b.cellCanBelongToDot(1, 1, 1, 2))

        b.addDot(2, 2)
        self.assertFalse(b.cellCanBelongToDot(0, 2, 1, 2))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:9,代码来源:tests.py

示例5: testMinimalBoardDots

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testMinimalBoardDots(self):
     expectedDots = []
     expectedDots.append({"i":0, "j":0})
     b = Board(2,2)
     b.addDot(0,0)
     i = 0
     for d in b.dots():
         self.assertEquals(d, expectedDots[i])
         i = i + 1
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:11,代码来源:tests.py

示例6: testDotOnWall

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
    def testDotOnWall(self):
        b = Board(2,2)
        b.addWall(1, 2)
        b.addDot(1, 2)
        self.assertEquals(
            """  0 1 j
 +-+-+
0| ø |
 + + +
1|   |
 +-+-+
i
""", b.toString())
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:15,代码来源:tests.py

示例7: testToString

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
    def testToString(self):
        b = Board(4, 4)
        b.addDot(2, 2)
        self.assertEqual(
            """  0 1 2 3 j
 +-+-+-+-+
0|       |
 + # + + +
1|       |
 + + + + +
2|       |
 + + + + +
3|       |
 +-+-+-+-+
i
""", b.toString())
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:18,代码来源:tests.py

示例8: testAddDotIsNotDash

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
    def testAddDotIsNotDash(self):
        b = Board(4, 4)
        b.addDot(2, 2)
        b.addDot(2, 1)
        self.assertEqual("""  0 1 2 3 j
 +-+-+-+-+
0|       |
 +o# + + +
1|       |
 + + + + +
2|       |
 + + + + +
3|       |
 +-+-+-+-+
i
""", b.toString())
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:18,代码来源:tests.py

示例9: testEmptyBoardIsNotSolved

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testEmptyBoardIsNotSolved(self):
     b = Board(4, 4)
     b.addDot(1, 1)
     self.assertFalse(b.isSolved())
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:6,代码来源:tests.py

示例10: testdotSeesCellLotsOfDots

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testdotSeesCellLotsOfDots(self):
     b = Board(4, 4)
     b.addDot(1, 1)
     b.addDot(1, 3)
     b.addDot(3, 1)
     self.assertFalse(b.dotSeesCell(1, 1, 3, 3))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:8,代码来源:tests.py

示例11: testFloats

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testFloats(self):
     b = Board(4, 4)
     self.assertTrue(b.cellIsWithinBoard(1, 1))
     b.addDot(3, 5)
     self.assertTrue(b.cellContainsDot(3, 5))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:7,代码来源:tests.py

示例12: testAddDotOnCrossing

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testAddDotOnCrossing(self):
     b = Board(4, 4)
     b.addDot(4, 4)
     self.assertTrue(b.isDot(4, 4))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:6,代码来源:tests.py

示例13: testDotOnEdge

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testDotOnEdge(self):
     b = Board(2,2)
     b.addDot(3, 2)
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:5,代码来源:tests.py

示例14: testdotSeesCellEmptyBoard

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testdotSeesCellEmptyBoard(self):
     b = Board(4, 4)
     b.addDot(1, 1)
     self.assertTrue(b.dotSeesCell(1, 1, 3, 3))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:6,代码来源:tests.py

示例15: testCanPutDotAroundDots

# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
 def testCanPutDotAroundDots(self):
     b = Board(4, 4)
     self.assertTrue(b._canPutDot(1, 2))
     b.addDot(1, 2)
     self.assertFalse(b._canPutDot(1, 2))
     self.assertTrue(b._canPutDot(4, 3))
开发者ID:tuxella,项目名称:Galaxies-Solver,代码行数:8,代码来源:tests.py


注:本文中的galaxySolver.Board.addDot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。