Alina Gilbard wrote:what i wanted to know is an idea
I assume you've done
recursion and
tree traversing - then the aim is to just try all the moves within a certain depth and see if you get a solution. If you do then the solution with the shortest depth is the best. If you don't then increase the depth. You'll need routines to try each move, a routine to check to see if the solution has been found, and something to remove the previous move.
Reading through the question I can't see why you're asked to store each move in a file - seems a bit pointless to me. I also couldn't see why you store the value "2/4" in the middle of the board state. I also couldn't see why you need to store everything in memory at the same time as surely you just store the current path through the tree rather than the whole tree. If you're doing it in
Java then it would be nice to print the board position at each point so you can see the game being solved.
Does that give you any ideas?