]> Untitled Git - axy/ft/a-maze-ing.git/commitdiff
lint master
authorAxy <gilliardmarthey.axel@gmail.com>
Sat, 21 Mar 2026 01:48:33 +0000 (02:48 +0100)
committerAxy <gilliardmarthey.axel@gmail.com>
Sat, 21 Mar 2026 01:48:33 +0000 (02:48 +0100)
__main__.py
amazeing/maze_display/TTYdisplay.py
amazeing/utils/avl.py
amazeing/utils/bi_map.py
amazeing/utils/quadtree.py
example.conf

index 81d3e84a22b3c339fc54060beec86e7a3046668e..85934b6541c6fbf8ef69c59082b8eaab65c75741 100644 (file)
@@ -11,12 +11,11 @@ import random
 
 from amazeing.config.config_parser import Config
 from amazeing.maze_class.maze_network_tracker import MazeNetworkTracker
-from amazeing.maze_class.maze_coords import Cardinal, CellCoord
+from amazeing.maze_class.maze_coords import CellCoord
 from amazeing.maze_class.maze_dirty_tracker import MazeDirtyTracker
 from amazeing.maze_class.maze_pacman_tracker import MazePacmanTracker
 from amazeing.maze_display.TTYdisplay import TileCycle, TileMaps, extract_pairs
 from amazeing.maze_display.backend import CloseRequested, IVec2
-from amazeing.utils import QuadTree
 
 config = Config.parse(open("./example.conf").read())
 
index df580e5dd7cff8246fa7cffd79b4d53898363fbd..5dead97b42281c21b3258fb44e08333085133108 100644 (file)
@@ -1,6 +1,6 @@
 from abc import ABC, abstractmethod
 from collections.abc import Callable, Generator, Iterable
-from amazeing.utils import BiMap, AVLTree
+from amazeing.utils import BiMap
 from amazeing.config.config_parser import Color, Config, ColoredLine, ColorPair
 from amazeing.maze_display.layout import (
     BInt,
index 08b82baca8cfcd8fefd883f58e3221db799604af..4c1970fcbd17a52db096124ae11cb998761340bc 100644 (file)
@@ -17,7 +17,7 @@ class Tree[T]:
 
     def __iter__(self) -> Iterator[T]:
         if self.root is None:
-            return ()
+            return iter(())
         return iter(self.root)
 
     def append(self, value: T) -> "Leaf[T]":
index ea331b28f863858d13497c657a0c7ddc4ab5a2f1..0a422507cb87891420e3c2ee3591c7c7958f2375 100644 (file)
@@ -11,7 +11,7 @@ class BiMap[K, R]:
         if self.revcontains(revkey):
             self.revremove(revkey)
         if not self.contains(key):
-            tree = AVLTree()
+            tree = AVLTree[R]()
             self.__map[key] = tree
             self.__revmap[tree] = key
         self.__leafmap[revkey] = self.__map[key].append(revkey)
@@ -40,7 +40,7 @@ class BiMap[K, R]:
         if src not in self.__map:
             return
         if dst not in self.__map:
-            tree = AVLTree()
+            tree = AVLTree[R]()
             self.__map[dst] = tree
             self.__revmap[tree] = dst
         self.__map[dst].rjoin(self.__map.pop(src))
index a3a71522e591f284adc6e53ae5ad12a593b39d58..9a2de7ae6b7df7caadd0a5980352b2138e6e22cc 100644 (file)
@@ -1,5 +1,4 @@
-from collections.abc import Callable, Generator, Iterable
-from typing import cast
+from collections.abc import Callable, Generator
 from amazeing.maze_display.backend import IVec2
 from functools import partial
 from itertools import chain
@@ -116,9 +115,9 @@ class Tree:
     def node_tiles(
         node: MaybeNode, pos: IVec2, height: int
     ) -> Generator[IVec2]:
-        if height == 0 and node == True:
+        if height == 0 and node is True:
             yield pos
-        if height == 0 or node == False:
+        if height == 0 or node is False:
             return
         for pos, node in zip4(
             Tree.node_starts(pos, height), Tree.node_split(node)
index e023c67a7578ec3acaed0dcd5a62e43e943a8dee..a0f7394f4dc7d8a57d798b5ba7fde6903db9fc7e 100644 (file)
@@ -1,5 +1,5 @@
-WIDTH=1000
-HEIGHT=1000
+WIDTH=100
+HEIGHT=100
 ENTRY=0,0
 EXIT=24,24
 OUTPUT_FILE=test