Beispiel #1
0
 def test_life_10(self):
   l1 = Life(1,1)
   c1 = FredkinCell(True)
   l1.addCell(0,0,c1)
   l1.populationEvolve()
   
   l2 = Life(1,1)
   c2 = ConwayCell(True)
   l2.addCell(0,0,c2)
   l2.populationEvolve()
   
   assert str(l2) == '.' and str(l1) == '-' 
Beispiel #2
0
 def test_life_12(self):
   l = Life(2,2)
   c1 = ConwayCell(True)
   c2 = ConwayCell(True)
   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.populationEvolve()
   
   assert str(l) == '**\n**'
Beispiel #3
0
 def test_life_11(self):
   l = Life(2,2)
   c1 = FredkinCell(True)
   c2 = FredkinCell(False)
   c3 = FredkinCell(False)
   c4 = FredkinCell(False)
   l.addCell(0,0,c1)
   l.addCell(0,1,c2)
   l.addCell(1,0,c3)
   l.addCell(1,1,c4)
   l.populationEvolve()
   
   assert str(l) == '-0\n0-'