// Connected judges whether the two points is connected by a path on the maze
Connected judges whether the two points is connected by a path on the maze
// Connected judges whether the two points is connected by a path on the maze
func (maze *Maze) Connected(point *Point, target *Point) bool {
	dir := maze.Directions[point.X][point.Y]
	for _, direction := range Directions {
		if dir&direction != 0 {
			next := point.Advance(direction)
			if next.X == target.X && next.Y == target.Y {
				return true
			}
		}
	}
	return false
}
func ( maze * Maze ) Connected ( point * Point , target * Point ) bool { dir := maze . Directions [ point . X ] [ point . Y ] for _ , direction := range Directions { if dir & direction != 0 { next := point . Advance ( direction ) if next . X == target . X && next . Y == target . Y { return true } } } return false }
Connected judges whether the two points is connected by a path on the maze
Connected judges whether the two points is connected by a path on the maze