crobertsbmw / deckofcards

An API to simulate a deck of cards
MIT License
1.34k stars 335 forks source link

Shuffling existing deck loses jokers if not re-specified #74

Closed AvianAnalyst closed 4 years ago

AvianAnalyst commented 4 years ago

Hey! This is great and I plan on using this to implement a game my work place plays over lunch so we can keep going through this quarantine period.

I noticed if I create a deck including jokers for the game, I can use "https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=4&jokers_enabled=true" and so far that seems to work great. The documentation states I can do "https://deckofcardsapi.com/api/deck/9njxoqfbo6h4/shuffle/" and I don't have to worry about re-specifying how many decks. When I call that, I get 208 instead of 216 cards back, so it seems like it's losing the jokers. If I append "?jokers_enabled=true" then I get the full 216 back again, is this expected behavior, or a bug?

I'd be happy to work on this and submit a PR but I wanted to make sure this wasn't expected behavior before I started work.

crobertsbmw commented 4 years ago

Ah, I would say that's a bug. I would love to review a PR if you want to do it!

Thanks, Chase

On Mon, Mar 23, 2020 at 12:49 PM AvianAnalyst notifications@github.com wrote:

Hey! This is great and I plan on using this to implement a game my work place plays over lunch so we can keep going through this quarantine period.

I noticed if I create a deck including jokers for the game, I can use " https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=4&jokers_enabled=true" and so far that seems to work great. The documentation states I can do " https://deckofcardsapi.com/api/deck/9njxoqfbo6h4/shuffle/" and I don't have to worry about re-specifying how many decks. When I call that, I get 208 instead of 216 cards back, so it seems like it's losing the jokers. If I append "?jokers_enabled=true" then I get the full 216 back again, is this expected behavior, or a bug?

I'd be happy to work on this and submit a PR but I wanted to make sure this wasn't expected behavior before I started work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/crobertsbmw/deckofcards/issues/74, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMQLHWN2WWMG2E6HOKSLP3RI6VJXANCNFSM4LSC6SHQ .

AvianAnalyst commented 4 years ago

Awesome! I'll start working on that tonight.

LoganDan commented 4 years ago

I just put in a PR for this. Let me know if I need to tweak anything.