From e659bd100db988e27174aacca800fc4864f52424 Mon Sep 17 00:00:00 2001 From: Caeden Perelli-Harris Date: Sun, 30 Jul 2023 19:32:58 +0100 Subject: [PATCH] Update cellular_automata/wa_tor.py Co-authored-by: Tianyi Zheng --- cellular_automata/wa_tor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellular_automata/wa_tor.py b/cellular_automata/wa_tor.py index cac151b6d..4a961c877 100644 --- a/cellular_automata/wa_tor.py +++ b/cellular_automata/wa_tor.py @@ -567,7 +567,7 @@ def display_visually(wt: WaTor, iter_number: int, *, colour: bool = True) -> Non output += "\n" entities = wt.get_entities() - prey_count = len(list(filter(lambda entity: entity.prey is True, entities))) + prey_count = sum(entity.prey for entity in entities) print( f"{output}\n Iteration: {iter_number} | Prey count: {prey_count} | "