crobertsbmw / deckofcards

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

Last card not drawn when drawing multiple specific cards from Pile. #113

Closed NicolasBrownGL closed 8 months ago

NicolasBrownGL commented 2 years ago
  1. Created new deck: https://deckofcardsapi.com/api/deck/new?jokers_enabled=true
  2. Drew top 13 cards (Spades): https://deckofcardsapi.com/api/deck/{{new_deck_j_id}}/draw/?count=13
  3. Created a pile from drawn cards (AS,2S) named 'spades_pile': https://deckofcardsapi.com/api/deck/{{new_deck_j_id}}/pile/spades_pile/add/?cards=AS,2S
  4. Added rest of drawn cards to pile: https://deckofcardsapi.com/api/deck/{{new_deck_j_id}}/pile/spades_pile/add/?cards=3S,4S,5S,6S,7S,8S,9S,0S,JS,QS,KS
  5. Listed cards in pile: https://deckofcardsapi.com/api/deck/{{new_deck_j_id}}/pile/spades_pile/list/ OK so far but when drawing 4 specific cards from pile: http://deckofcardsapi.com/api/deck/{{new_deck_j_id}}/pile/spades_pile/draw/?cards=5S,6S,7S,8S

Expected result is that all 4 drawn cards are listed and remaining number of cards in pile is 9 Actual result is that last value passed(8S) is not listed and remaining number of cards in pile is 10

crobertsbmw commented 2 years ago

Sorry it took so long for me to get to this. I walked through all these steps with new_deck_j_id = pb05i5fz7nan, and everything seemed to work as expected. You can see the list of cards has 9 remaining: https://deckofcardsapi.com/api/deck/pb05i5fz7nan/pile/spades_pile/list/

fecresgam commented 8 months ago

Hi,

I've also try to replicate this issue. Everything is working properly, @NicolasBrownGL

If you want to execute it just clone my repo https://github.com/fecresgam/karate-deckofcards

and execute mvn clean test -Dkarate.options="--tags @issue113".

I suggest to close this issue since nobody seems to be able to replicate it, @crobertsbmw .

crobertsbmw commented 8 months ago

Thanks!