1.1 --- a/caumat.py Thu Dec 30 15:19:36 2010 +0100
1.2 +++ b/caumat.py Thu Dec 30 15:56:07 2010 +0100
1.3 @@ -62,7 +62,10 @@
1.4 def grow(self, grid, (x, y)):
1.5 n1 = [(x-1, y), (x, y+1), (x+1, y), (x, y-1)]
1.6 n2 = [(x+1, y+1), (x+1, y-1), (x-1, y-1), (x-1, y+1)]
1.7 - neighbours = random.choice((n1, n1, n1, n1, n1, n1, n2, n2, n2))
1.8 + c0 = (n1, )
1.9 + c1 = (n1, n2)
1.10 + c2 = (n1, n1, n2)
1.11 + neighbours = random.choice(random.choice((c0, c1, c2)))
1.12 neighbours = [n for n in neighbours if n not in grid.cells]
1.13 if len(neighbours):
1.14 pos = random.choice(neighbours)