We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a87d672 commit bf422b1Copy full SHA for bf422b1
cellular_automata/wa_tor.py
@@ -203,7 +203,7 @@ def balance_predators_and_prey(self) -> None:
203
shuffle(entities)
204
205
if len(entities) >= MAX_ENTITIES - MAX_ENTITIES / 10:
206
- prey = list(filter(lambda entity: entity.prey is True, entities))
+ prey = [entity for entity in entities if entity.prey]
207
predators = list(filter(lambda entity: entity.prey is True, entities))
208
209
prey_count, predator_count = len(prey), len(predators)
0 commit comments