Skip to content

Commit e659bd1

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cellular_automata/wa_tor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def display_visually(wt: WaTor, iter_number: int, *, colour: bool = True) -> Non
567567
output += "\n"
568568

569569
entities = wt.get_entities()
570-
prey_count = len(list(filter(lambda entity: entity.prey is True, entities)))
570+
prey_count = sum(entity.prey for entity in entities)
571571

572572
print(
573573
f"{output}\n Iteration: {iter_number} | Prey count: {prey_count} | "

0 commit comments

Comments
 (0)