From: Christian Heller Date: Wed, 27 Feb 2019 08:47:11 +0000 (+0100) Subject: Fix reproducibility bug due to unstable iteration order. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/git-logo.png?a=commitdiff_plain;h=76d1e8d03aea96af9339c0021922ac314c0c2a5c;p=plomrogue2-experiments Fix reproducibility bug due to unstable iteration order. --- diff --git a/new/plomrogue/things.py b/new/plomrogue/things.py index 5ef4297..9bc8490 100644 --- a/new/plomrogue/things.py +++ b/new/plomrogue/things.py @@ -63,7 +63,7 @@ class ThingAnimate(Thing): neighbors = dijkstra_map.get_neighbors(tuple(self.position)) n = n_max target_direction = None - for direction in neighbors: + for direction in sorted(neighbors.keys()): yx = neighbors[direction] if yx is not None: n_new = dijkstra_map[yx]