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

Multiple card.throwIn doesn't work correctly #123

Open
kryl9 opened this issue Dec 11, 2017 · 2 comments
Open

Multiple card.throwIn doesn't work correctly #123

kryl9 opened this issue Dec 11, 2017 · 2 comments
Labels

Comments

@kryl9
Copy link

kryl9 commented Dec 11, 2017

If we get 5 cards and consistently swing 3, than call card.throwIn three times we do not get the desired stack — first card3.throwIn return the corerct card to the top of stack, but other calls will return next cards (card2, card1) behind the third

Steps:

Initial stack

card1
card2
card3
card4
card5

Swinging first 3..

State 1:

Stack

card4
card5

Trash

card3
card2
card1

Starting throwIn

card3.throwIn(0,0)

State 2:

Stack

card3
card4
card5

Trash

card2
card1

Continue throwIn

card2.throwIn(0,0)

State 3:

Stack

card3
card2
card4
card5

Trash

card1

Continue throwIn

card1.throwIn(0,0)

State 4:

Stack

card3
card2
card1
card4
card5

Trash empty

Any ideas? Thanx

@gajus
Copy link
Owner

gajus commented Dec 12, 2017

Looks like an easy to pick up PR.

@amishas157
Copy link

amishas157 commented Dec 23, 2017

Hey! Following are the steps we followed in order to reproduce the issue:

cd examples/card-stack
npm install && npm link
npm start (to start localhost server)

Add <li class="hearts">♥</li> at the end of https://github.com/gajus/swing/blob/master/examples/card-stack/index.html#L16-L19

And trying throwing in and throwing out the cards. But the stack order looks good and hence not able to reproduce the issue.

Not sure if I followed correct steps. Will need some help. 🙇‍♀️

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

No branches or pull requests

3 participants