Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
Caeden Perelli-Harris 2023-07-30 19:35:18 +01:00 committed by GitHub
parent d277dba404
commit 9d8afeb9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,8 +167,8 @@ class WaTor:
while True: while True:
row, col = randint(0, self.height - 1), randint(0, self.width - 1) row, col = randint(0, self.height - 1), randint(0, self.width - 1)
if self.planet[row][col] is None: if self.planet[row][col] is None:
break self.planet[row][col] = Entity(prey=prey, coords=(row, col))
self.planet[row][col] = Entity(prey=prey, coords=(row, col)) return
def get_entities(self) -> list[Entity]: def get_entities(self) -> list[Entity]:
""" """