Skip to content

Cards not tracked #12

@gruaig

Description

@gruaig

I noticed everytime you deal it's local randomCard = math.random(1,52)

Keep the available card (or card indexes) in a list. Then remove a random card (or index) like this:

Random random = new Random();
List deck = new ArrayList<>();
// ...
int randomIndex = random.nextInt(deck.size());
Card nextCard = deck.remove(randomIndex);

Possibly add more decks and a shuffle function. Because currently, it doesn't seem fair. Also without being able to double and split

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