https://github.com/CharlieHess/slack-poker-bot/blob/master/s...
https://github.com/CharlieHess/slack-poker-bot/blob/master/s...
I can look into doing this myself and submitting a PR after I get home, as well.
Shuffling, by swapping each card with any of the 52 other spots produces 52^52 (i.e. 52 * 52 * 52 * ...) arrangements. How can this be when there are only 52! (i.e. 52 * 51 * 50 * ...) possible arrangements. The answer is than many of the arrangements generated by this shuffling technique end up with the cards in the same order. This follows from the pigeon-hole theorem since 52^52 > 52!
Furthermore, we know that 52^52 is not a multiple of 52! (to see this realize that, for example, 11 divides 52! but not 52^52). Therefore, some bad shuffle generated arrangements will occur more than others and, consequently, that bad shuffle algorithm does not produce a "fair" shuffle.
Deck.getRandomInt(index+1, numberOfCards)
instead of
Deck.getRandomInt(0, numberOfCards)
It's random but some results are overrepresented so more likely to occur. If you knew this and bet on this over time you would gain an advantage