Skip to content
This repository was archived by the owner on Jul 7, 2024. It is now read-only.
This repository was archived by the owner on Jul 7, 2024. It is now read-only.

ConnectFour does not correctly choose a random player on start #1

Description

@notm1ke

The problem

ConnectFour always chooses first player to join as player to start first instead of being truly random.

The following is the code associated with selecting a random entry from a generic list.
Other methods of generating pseudo-random numbers will be employed in order to get a more variable outcome.

private <T> T getRandom(List<T> array) {
   return array.get(new Random().nextInt(array.size() - 1));
}

Note

We have tried both using the Basic (0.3) RandomUtils utility and a modified one, but neither produce a favorable outcome.

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