コード例 #1
0
ファイル: tests.py プロジェクト: gmauricio/game-of-life
	def test_counting_0_corner_cell_neighbours(self):
		world = World(2, 2)
		world.set([
			[Cell(0), Cell(0)],
			[Cell(0), Cell(0)]
		])
		self.assertEqual(0, world.get_neighbourhoods()[0][0])
コード例 #2
0
ファイル: tests.py プロジェクト: gmauricio/game-of-life
	def test_counting_4_center_cell_4_neighbours(self):
		world = World(3, 2)
		world.set([
			[Cell(1), Cell(1), Cell(1)],
			[Cell(1), Cell(1), Cell(0)]
		])
		self.assertEqual(4, world.get_neighbourhoods()[0][1])