the obligatory deck of cards.
cards | [R] | |
order | [R] |
Perform a count cut using the value of the bottom card. Cut the bottom card‘s value in cards off the top of the deck and reinsert them just above the bottom card.
Return the next kestream value as a number (not a string). Keep going until we have a non-joker value.
Return the output number (not letter). Convert the top card to it‘s value and count down that many cards from the top of the deck, with the top card itself being card number one. Look at the card immediately after your count and convert it to a letter. This is the next letter in the keystream. If the output card is a joker, no letter is generated this sequence. This step does not alter the deck.
Shuffle the deck using the initialization number init and the method method. Currently there are only two methods: :fisher_yates and naive.