cau/rules.py
changeset 11 a131769728f1
parent 8 0db344245ac2
     1.1 --- a/cau/rules.py	Sun Jan 09 16:23:29 2011 +0100
     1.2 +++ b/cau/rules.py	Mon Jul 18 00:51:04 2011 +0200
     1.3 @@ -1,8 +1,12 @@
     1.4 +"""
     1.5 +Description: Circular cellular growth rules.
     1.6 +Author: Eugen Sawin <sawine@me73.com>
     1.7 +"""
     1.8 +
     1.9  import copy
    1.10  from grid import Grid
    1.11  
    1.12  class Rule1(object):
    1.13 -
    1.14  	def iterate(self, oldgrid):
    1.15  		grid = copy.deepcopy(oldgrid)
    1.16  		for x in xrange(oldgrid.minx - 1, oldgrid.maxx + 2):
    1.17 @@ -25,7 +29,6 @@
    1.18  	
    1.19  
    1.20  class Rule2(object):
    1.21 -
    1.22  	def iterate(self, oldgrid):
    1.23  		grid = copy.deepcopy(oldgrid)
    1.24  		for x in xrange(oldgrid.minx - 1, oldgrid.maxx + 2):
    1.25 @@ -38,8 +41,7 @@
    1.26  import random
    1.27  import marshal
    1.28  
    1.29 -class PotentialGrowth(object):
    1.30 -		
    1.31 +class PotentialGrowth(object):		
    1.32  	def __init__(self):
    1.33  		random.seed()
    1.34  		self.potential = 4 # values 4-8 are viable