(
self,
board: List[List[int]],
goal: List[List[int]],
moves: int = 0,
previous: Optional["PuzzleState"] = None,
)
| 6 | """Represents a state in 8-puzzle solving with A* algorithm.""" |
| 7 | |
| 8 | def __init__( |
| 9 | self, |
| 10 | board: List[List[int]], |
| 11 | goal: List[List[int]], |
| 12 | moves: int = 0, |
| 13 | previous: Optional["PuzzleState"] = None, |
| 14 | ) -> None: |
| 15 | self.board = board # Current 3x3 board configuration |
| 16 | self.goal = goal # Target 3x3 configuration |
| 17 | self.moves = moves # Number of moves taken to reach here |
| 18 | self.previous = previous # Previous state in solution path |
| 19 | |
| 20 | def __lt__(self, other: "PuzzleState") -> bool: |
| 21 | """For PriorityQueue ordering: compare priorities.""" |
nothing calls this directly
no outgoing calls
no test coverage detected