|
@@ -60,6 +60,9 @@ class GameOfLife:
|
60
|
60
|
continue
|
61
|
61
|
if self.alive(data, x + xOff, y + yOff):
|
62
|
62
|
c += 1
|
|
63
|
+ if c == 4:
|
|
64
|
+ # 4 or more is not interesting for us
|
|
65
|
+ break
|
63
|
66
|
return c
|
64
|
67
|
|
65
|
68
|
def step(self):
|
|
@@ -113,8 +116,9 @@ if __name__ == "__main__":
|
113
|
116
|
g = GameOfLife(t)
|
114
|
117
|
|
115
|
118
|
def helperRestart():
|
116
|
|
- c = (random.randrange(0, 256), random.randrange(0, 256), random.randrange(0, 256))
|
117
|
|
- g.setColors(c, (0, 0, 0))
|
|
119
|
+ c1 = (random.randrange(0, 256), random.randrange(0, 256), random.randrange(0, 256))
|
|
120
|
+ c2 = (random.randrange(0, 128), random.randrange(0, 128), random.randrange(0, 128))
|
|
121
|
+ g.setColors(c1, c2)
|
118
|
122
|
|
119
|
123
|
# start out with random colors
|
120
|
124
|
helperRestart()
|