Desired output card sequence

(H1 (Hearts 1), DK (Diamond King), CJ (Clubs Joker), S3 (Spades 3))

{{inputDuplicates ? 'You entered duplicate cards' : '----' }}

{{getCardNumber(c)}}

Starting card sequence (Solving)

{{getCardNumber(c)}}
Number of required rotations on total {{solvedOutput.length}} cards
{{r.length}} - {{$index ? ',' : ''}}{{r2}}

How does it work?

Lets assume i have a stack of 10 cards, arranged in a secret sequence (Starting card sequence).

  • 1. Take one card out of the stack, and place it on the table.
  • 2. Take another card out of the stack and place it at the bottom of the same stack.
  • 3. Goto step 1, and repeat until all cards are over.

The cards on the table are in sequential order.

This program generates the card sequence required to get the desired output.

Thanks to a friend @pranav
Fork it @ https://github.com/craftpip/card-rotation-sequence
License MIT