Skip to content

Cards not tracked #12

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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