목록maze (2)
일상 코딩
maze.py from enum import Enum from typing import List, NamedTuple, Callable, Optional import random from math import sqrt from urllib.parse import MAX_CACHE_SIZE from generic_search import dfs, node_to_path, Node #, bfs, astar class Cell(str, Enum): EMPTY = " " BLOCKED = "X" START = "S" GOAL = "G" PATH = "*" class MazeLocation(NamedTuple): row: int column: int class Maze: def __init__(self, rows..

from enum import Enum from typing import List, NamedTuple, Callable, Optional import random from math import sqrt from urllib.parse import MAX_CACHE_SIZE # from generic_search import dfs, bfs, node_to_path, astar, Node class Cell(str, Enum): EMPTY = " " BLOCKED = "X" START = "S" GOAL = "G" PATH = "*" class MazeLocation(NamedTuple): row: int column: int class Maze: def __init__(self, rows: int = ..