Check if current state matches goal.
(self)
| 41 | |
| 42 | |
| 43 | def is_goal(self) -> bool: |
| 44 | """Check if current state matches goal.""" |
| 45 | return self.board == self.goal |
| 46 | |
| 47 | def neighbors(self) -> List["PuzzleState"]: |
| 48 | """Generate all valid neighboring states by moving empty tile (0).""" |