Here's my solution, in Haskell. It uses the A* path-finding algorithm using Manhattan/taxi-cab distance as the heuristic.
I don't think using a list is the best data-structure for holding the open and closed sets. It isn't great for searching for a minimum and removing elements from the middle. I might revisit this and look for a better solution, but for this challenge, it's fast enough.
There are also some things in my solution that I'm not entirely happy about. For one, getRequiredMove isn't a complete function but I didn't like my other ideas on how to put get the Move in the Tile, so I stuck with this.
Here's my solution, in Haskell. It uses the A* path-finding algorithm using Manhattan/taxi-cab distance as the heuristic.
I don't think using a list is the best data-structure for holding the open and closed sets. It isn't great for searching for a minimum and removing elements from the middle. I might revisit this and look for a better solution, but for this challenge, it's fast enough.
There are also some things in my solution that I'm not entirely happy about. For one,
getRequiredMove
isn't a complete function but I didn't like my other ideas on how to put get the Move in the Tile, so I stuck with this.