The game is implemented in various languages, including PHP Ruby and Python and most seem to be structured as:
- create a randomized list of numbers
- while the list is not sorted:
- ask for and input the number to be reversed
- reverse that portion of the list.
Here is proof for Python:
If you were testing an implementation or otherwise running it, every once in a while it would just exit. Run it again and it would most likely work for a long time. It is not something I would like to use the normal xUnit type tests/continuous testing regime to uncover as although a transient fail would be noted, those test regimes rely heavily on easy reproducibility of the failure.
>>> n = 10
>>> sortlist = range(n)
>>> randlist = range(n)
>>> x = 0
>>> while randlist != sortlist:
... x += 1
>>> print x
I guess what would be needed is knowledge of corner cases. For shuffle, corner cases to think of would include returning the input order, reverse input order, sorted, and reverse sorted order.
P.S. Work pays me to be this finickity when testing ASICs