(self)
| 141 | col = 0 |
| 142 | |
| 143 | def Run(self): |
| 144 | self.population = 0 |
| 145 | for cell in self.cells: |
| 146 | if cell.alive: |
| 147 | self.population += 1 |
| 148 | if len(cell.a_neighbors) < 2: |
| 149 | cell.die() |
| 150 | elif len(cell.a_neighbors) > 3: |
| 151 | cell.die() |
| 152 | elif len(cell.a_neighbors) == 2 or len(cell.a_neighbors) == 3: |
| 153 | cell.live() |
| 154 | else: |
| 155 | if len(cell.a_neighbors) == 3: |
| 156 | cell.live() |
| 157 | |
| 158 | def blitDirections(self): |
| 159 | text = self.font.render("Press Enter to begin, and Space to stop and clear board", 1, (255,255,255)) |
no test coverage detected