crobertsbmw / deckofcards

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

Adding to Piles method does not work #130

Open nurzhanme opened 1 year ago

nurzhanme commented 1 year ago

Adding to Piles method returns the same deck as it was before, even though deck contains cards I want to draw and add to pile

Steps to reproduce:

  1. Call https://deckofcardsapi.com/api/deck/new/shuffle/

    1
  2. Take deck_id and put to https://deckofcardsapi.com/api/deck/<<deck_id>>/pile/p1/add/?cards=AS,2S

    2
  3. Then call https://deckofcardsapi.com/api/deck/<<deck_id>>/pile/p1/list/

    3

And deck still has 52 cards and pile p1 is empty

crobertsbmw commented 1 year ago

This is the designed behavior. You can’t add cards to a pile until you have first drawn them from the deck.

On Sun, Apr 9, 2023 at 4:27 PM Nurzhan Aitbayev @.***> wrote:

Adding to Piles method returns the same deck as it was before, even though deck contains cards I want to draw and add to pile

Steps to reproduce:

  1. Call https://deckofcardsapi.com/api/deck/new/shuffle/

[image: 1] https://user-images.githubusercontent.com/4818097/230799389-cbf5b832-7391-4c4a-9055-3145ca7d43de.png

  1. Take deck_id and put to https://deckofcardsapi.com/api/deck/ <>/pile/p1/add/?cards=AS,2S

[image: 2] https://user-images.githubusercontent.com/4818097/230799390-2677c28c-b0a5-4297-9d15-c68aad36d20d.png

  1. Then call https://deckofcardsapi.com/api/deck/<>/pile/p1/list/

[image: 3] https://user-images.githubusercontent.com/4818097/230799391-ad080a65-cdeb-4574-b55d-b5186299f96a.png

And deck still has 52 cards and pile player1 is empty

— Reply to this email directly, view it on GitHub https://github.com/crobertsbmw/deckofcards/issues/130, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMQLHSU4YV4QAJ7RDPFQXTXAMZWPANCNFSM6AAAAAAWYLUK2E . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Chase Roberts

Computer Engineering for Babies https://computerengineeringforbabies.com/

https://computerengineeringforbabies.com @.***> https://www.instagram.com/ce_for_babies/ https://twitter.com/crobertsbmw https://www.linkedin.com/in/chase-roberts-22b28128/

https://computerengineeringforbabies.com