Algorithm for winning solitaire
There sure is. Some sort of backtracking program will do the job. If you want the minimal number of moves, perhaps the (memory expensive) way to go is breadth first search. Maybe you can squeeze some performance out of it by adding conditions to cut off impossible branches or stop expanding when the current path is longer than the current best, or heuristics to search more promising moves first.
The eight queens puzzle is the typical example of backtracking in a much simpler setting, the cited page has a sample Pascal program (readable enough for any C-savy person). Dijkstra wrote a highly detailed discussion of the program, see his &quot;EWD316: A Short Introduction to the Art of Programming&quot;.