Skip to content

restartDeal is wrong, inverts the order of the pile #103

Description

@ThoAppelsin

state.deal.pile.cards = state.deal.deal.cards;

As you restart a deal, you flip the bunch of face-up cards altogether, not one by one. So the card that was at the bottom of the face-up pile becomes the top card in the restarted deal.

Right now, the cards are being flipped one by one. Certainly wrong—think how weird it'd be to do this in real life. And it's not how Win98 Solitaire works either.

The fix is easy. Just reverse the deal.deal.cards here before assigning it to deal.pile.cards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions