mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Update cellular_automata/wa_tor.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
parent
a9fb2ed3fa
commit
e659bd100d
@ -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} | "
|
||||
|
Loading…
x
Reference in New Issue
Block a user