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