This is a fork of [Courtney Pitcher's project](https://github.com/IgniparousTempest/javascript-tri-peaks-solitaire-solver), which I've modified for my own purposes.
The most significant addition is that this solver will return one possible "best path" for unsolvable games — a set of moves that clears the most cards from the board.
This can help with games where the goal is not clearing the board, but clearing a certain set of cards or hitting a threshold of points.
_NOTE:_ The "best path" returned is the first one found that clears the most cards. Hypothetically, a board could have multiple paths to clear the same number of cards. The path the solver returns might not clear the cards you need to clear. A possible future improvement could be returning, say, the top 5 best paths.
_NOTE:_ Unsolvable boards can take a long time to process, so be patient. The sample unsolvable board below takes my computer almost 6 minutes to conclude.
I have yet to implement this in a website but it can be run directly in node. Eventually I'll put up a sample into which you can enter a string like one of these and get a solution:
Per Courtney Pitcher, "This is probably quite a poor implementation." Please don't fault either of us, he was teaching himself javascript, and I'm probably even less qualified...
## Tests
The test for an unsolvable board will cause the tests to take a long time to complete, almost 6 minutes on my computer.