本文整理汇总了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))
示例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))
示例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))
示例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))
示例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
示例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())
示例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())
示例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())
示例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())
示例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))
示例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))
示例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))
示例13: testDotOnEdge
# 需要导入模块: from galaxySolver import Board [as 别名]
# 或者: from galaxySolver.Board import addDot [as 别名]
def testDotOnEdge(self):
b = Board(2,2)
b.addDot(3, 2)
示例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))
示例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))