|
In Solvitaire, going through the stock in stock-waste games is bundled
with the move out of the waste, in what's called a k-plus move. This
makes sense in Solvitaire, but in this system having each stock move be
explicit helps because it itemises all moves similarly, making shaving
off single moves easy.
The `calculate_stock_moves` function uses a simulation rather than a
simple calculation, which has a couple of downsides:
1. it's slower than a calculation;
2. it loops infinitely when given an index that's impossible to reach.
|