Hand Solitaire Simulation Algorithm in C++