I'm trying to code a puzzle solver app. I need to find out how many moves it takes, and how many solutions there are.
I would rather not give too many details on the puzzle. but the player moves around a grid ( say 5 x 7 ) as they move, obstacles could be captured so the state of the board needs to be tracked. ( this could be done as a string or an array )
I understand I need to create a TreeNode, starting with a root ( the players start position ) and give each node children of the possible moves until all the possible moves are calculated. The puzzle stats could then be collected. Number of Possible solutions, minimum number of moves to solve, average number of moves to solve, etc.
I have the puzzle logic created that will return if moves are possible and such. I'm having problems creating the TreeNode structure and making sure moves are not duplicated.
The puzzle app itself is on the iPhone, but I'm writing this solver/editor on the Mac. Any help would be VERY much appreciated.