Rush Hour
if you\'re not familiar with it, the game consists of a collection of cars of varying sizes, set either horizontally or vertically, on a NxM grid
I think recursion is a bad idea, unless you keep track of what you've already visited; you could end up recursing infinitely by moving a car back and forth.
Maybe this is a good start: Represent and store each board state as an undirected graph. Then for each possible move, check against past states to make sure you're not just hitting the same state again.
Now make another undirected graph where nodes represent states and edges represent the ability to get from one state to another via moving a car. Explore states until one of them is a solution. Then follow the edges back to the beginning to find out a move path.