From 1ffc7ded742fbe3f11ea3eeafeb5f43277020aa6 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Sat, 27 Mar 2021 15:05:01 +0100 Subject: [PATCH] Fix Random.nextInt(int) in Random.java --- src/battleship/model/player/Random.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battleship/model/player/Random.java b/src/battleship/model/player/Random.java index b5c6e14..e623826 100644 --- a/src/battleship/model/player/Random.java +++ b/src/battleship/model/player/Random.java @@ -2,12 +2,12 @@ package battleship.model.player; import battleship.utils.Pair; -public class Random extends Player{ +public class Random extends Player { @Override public Pair chooseMove() { - Random rand = new Random(); - int index = validMoves().get(rand.nextInt(validMoves().size())); - return validMoves().get(index); + java.util.Random rand = new java.util.Random(); + // Pair index = validMoves().get(rand.nextInt(validMoves().size())); + return validMoves().get(rand.nextInt(validMoves().size())); } }