From 9f23c25f965f8873c41e7e7bfe977867fd0d7fd3 Mon Sep 17 00:00:00 2001 From: Caeden Perelli-Harris Date: Sun, 30 Jul 2023 19:29:49 +0100 Subject: [PATCH] Update cellular_automata/wa_tor.py Co-authored-by: Tianyi Zheng --- cellular_automata/wa_tor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cellular_automata/wa_tor.py b/cellular_automata/wa_tor.py index c7b46ccab..c32f7c02e 100644 --- a/cellular_automata/wa_tor.py +++ b/cellular_automata/wa_tor.py @@ -551,9 +551,9 @@ def display_visually(wt: WaTor, iter_number: int, *, colour: bool = True) -> Non output = "" # Iterate over every entity in the planet - for i in range(len(planet)): - for j in range(len(planet[0])): - if (entity := planet[i][j]) is None: + for row in planet: + for entity in row: + if entity is None: output += " . " else: if colour is True: