Skip to content

Commit 9d8afeb

Browse files
Update cellular_automata/wa_tor.py
Co-authored-by: Tianyi Zheng <[email protected]>
1 parent d277dba commit 9d8afeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cellular_automata/wa_tor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ def add_entity(self, prey: bool) -> None:
167167
while True:
168168
row, col = randint(0, self.height - 1), randint(0, self.width - 1)
169169
if self.planet[row][col] is None:
170-
break
171-
self.planet[row][col] = Entity(prey=prey, coords=(row, col))
170+
self.planet[row][col] = Entity(prey=prey, coords=(row, col))
171+
return
172172

173173
def get_entities(self) -> list[Entity]:
174174
"""

0 commit comments

Comments
 (0)