vijayan121
Posting Virtuoso
1,606 posts since Dec 2006
Reputation Points: 1,159
Solved Threads: 287
Perhaps start with a deck of cards (or maybe just one suit for easy handling), and try your algorithm out for real.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Stop trying to write code before you've fully understood the process for one thing.
Shuffle a suit, then look at the cards to see what order they're in.
Then implement your "algorithm" until you've moved 13 cards, then look at them again to see how the situation has changed.
- are they fully sorted
- are they still unsorted, but it's looking a bit better
- is it the same as it was before.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953