コード例 #1
0
ファイル: TestLife.py プロジェクト: jjloftin/cs313e-life
 def test_life_40(self):
   l = Life(2,2)
   c1 = ConwayCell(True)
   c2 = ConwayCell(False)
   c3 = ConwayCell(False)
   c4 = ConwayCell(True)
   l.addCell(0,0,c1)
   l.addCell(0,1,c2)
   l.addCell(1,0,c3)
   l.addCell(1,1,c4)
   
   l.cellExecute(1,1)
   assert l.liveNeighbors() == 0
コード例 #2
0
ファイル: TestLife.py プロジェクト: jjloftin/cs313e-life
 def test_life_42(self):
   l = Life(2,2)
   c1 = ConwayCell(True)
   c2 = ConwayCell(True)
   c3 = FredkinCell()
   c4 = FredkinCell()
   l.addCell(0,0,c1)
   l.addCell(0,1,c2)
   l.addCell(1,0,c3)
   l.addCell(1,1,c4)
   
   l.countLives()
   l.cellExecute(1,1)
   
   assert l.liveNeighbors() == 1
コード例 #3
0
ファイル: TestLife.py プロジェクト: jjloftin/cs313e-life
 def test_life_47(self):
   l = Life(2,2)
   c1 = FredkinCell(True)
   c2 = FredkinCell(True)
   c3 = FredkinCell(True)
   c4 = FredkinCell(False)
   
   l.addCell(0,0,c1)
   l.addCell(0,1,c2)
   l.addCell(1,0,c3)
   l.addCell(1,1,c4)
   
   l.countLives()
   l.cellExecute(1,1)
   
   assert not c1.getAlive()
コード例 #4
0
ファイル: TestLife.py プロジェクト: jjloftin/cs313e-life
 def test_life_45(self):
   l = Life(2,2)
   c1 = ConwayCell(True)
   c2 = ConwayCell(True)
   c3 = ConwayCell(True)
   c4 = ConwayCell(False)
   
   l.addCell(0,0,c1)
   l.addCell(0,1,c2)
   l.addCell(1,0,c3)
   l.addCell(1,1,c4)
   
   l.countLives()
   l.cellExecute(2,2)
   
   assert c4.getAlive()