Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order a pile or the entire deck #89

Open
brneor opened this issue Sep 10, 2020 · 4 comments
Open

Order a pile or the entire deck #89

brneor opened this issue Sep 10, 2020 · 4 comments

Comments

@brneor
Copy link

brneor commented Sep 10, 2020

Is there currently a method to order the cards? This is a nice to have feature.

@crobertsbmw
Copy link
Owner

crobertsbmw commented Sep 10, 2020 via email

@johnnycopes
Copy link

Agreed that it would be really helpful for debugging purposes. The use case I've come across is that it'd be useful create a deck of select cards in a specific order in order to write tests for particular outcomes

@roiko20
Copy link

roiko20 commented Dec 12, 2020

I agree as well, it will be a great feature.
If I create a partial deck and the order of cards is important for the logic of my app, when I call:
https://deckofcardsapi.com/api/deck/new/?cards=2C,8H,3D,JC,9S,4S,7C,2D,0C,QH,3H,6D,8C,AH,0D,KC,7H,KD,9C,3S,8D
for example, which should return unshuffled as /shuffle/ is not specified, when I draw cards from it, it does not return in the order I specified.
It always returns ordered, I think it's Spades->Diamonds->Clubs->Hearts, so in the above example, I always get 3S first.
However, getting 2C,8H,3D... as in the order I specified in the new deck request is important for me.
This is a great project, really appreciate it!
Managed to solve this by creating a "main" pile that holds the cards in the order I specified, but it'll also be great to do it on the deck's level.

@crobertsbmw
Copy link
Owner

crobertsbmw commented Dec 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants