I posted this question two years ago. And I\'m in the same position again! for this years d10 puzzle.
The recursive core of the algorithm looks like:
r