| 118 | pass |
| 119 | |
| 120 | class Grid: |
| 121 | def __init__(self, height, width): |
| 122 | self.height = height |
| 123 | self.width = width |
| 124 | self.rows = [] |
| 125 | for _ in range(self.height): |
| 126 | self.rows.append([EMPTY] * self.width) |
| 127 | |
| 128 | def get(self, y, x): |
| 129 | return self.rows[y % self.height][x % self.width] |
| 130 | |
| 131 | def set(self, y, x, state): |
| 132 | self.rows[y % self.height][x % self.width] = state |
| 133 | |
| 134 | def __str__(self): |
| 135 | output = "" |
| 136 | for row in self.rows: |
| 137 | for cell in row: |
| 138 | output += cell |
| 139 | output += "\n" |
| 140 | return output |
| 141 | |
| 142 | |
| 143 | def count_neighbors(y, x, get_cell): |
no outgoing calls
no test coverage detected