本文整理汇总了Python中Life.Life.is_conway方法的典型用法代码示例。如果您正苦于以下问题:Python Life.is_conway方法的具体用法?Python Life.is_conway怎么用?Python Life.is_conway使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Life.Life
的用法示例。
在下文中一共展示了Life.is_conway方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_conway_5
# 需要导入模块: from Life import Life [as 别名]
# 或者: from Life.Life import is_conway [as 别名]
def test_is_conway_5(self):
x = Life(5, 3, [['0','0','0'], ['*','-','-'], ['-','-','*'], ['-','-','*'], ['-','-','*']])
x.moat_grid()
x.grid[2][3].type_cell = 'Fredkin'
self.assertEqual(False, x.is_conway(2, 3))
示例2: test_is_conway_6
# 需要导入模块: from Life import Life [as 别名]
# 或者: from Life.Life import is_conway [as 别名]
def test_is_conway_6(self):
x = Life(5, 3, [['0','0','0'], ['*','-','-'], ['-','-','*'], ['-','-','*'], ['-','-','*']])
x.moat_grid()
x.grid[0][0].type_cell = 'Conway'
self.assertEqual(True, x.is_conway(0, 0))
示例3: test_is_conway_2
# 需要导入模块: from Life import Life [as 别名]
# 或者: from Life.Life import is_conway [as 别名]
def test_is_conway_2(self):
x = Life(5, 3, [['.','.','.'], ['*','.','.'], ['*','*','*'], ['.','.','*'], ['.','.','*']])
x.moat_grid()
x.grid[2][3].type_cell = 'Conway'
self.assertEqual(True, x.is_conway(2, 3))