Closed flakmonkey closed 9 years ago
Sorry I didn't just create a pull request, but I'm on my mobile.
I believe the shuffle algorithm here is incorrect: https://github.com/CharlieHess/slack-poker-bot/blob/master/src/deck.js
My understanding is that you only want to swap the current card with cards that have a greater index in the deck, basically creating a shuffled and unshuffled part of the deck. It's explained better here: http://www.i-programmer.info/programming/theory/2744-how-not-to-shuffle-the-kunth-fisher-yates-algorithm.html
Thanks for reporting @flakmonkey. Fixed here.
Sorry I didn't just create a pull request, but I'm on my mobile.
I believe the shuffle algorithm here is incorrect: https://github.com/CharlieHess/slack-poker-bot/blob/master/src/deck.js
My understanding is that you only want to swap the current card with cards that have a greater index in the deck, basically creating a shuffled and unshuffled part of the deck. It's explained better here: http://www.i-programmer.info/programming/theory/2744-how-not-to-shuffle-the-kunth-fisher-yates-algorithm.html