From d116f6df53249fe22bd42e0efb17bf391a6f2bea Mon Sep 17 00:00:00 2001 From: FelixKrull Date: Wed, 16 Feb 2022 00:41:41 +0100 Subject: [PATCH] Add Fix return value --- src/main/java/AIPlayer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/AIPlayer.java b/src/main/java/AIPlayer.java index f6aa6cb..4e8fe36 100644 --- a/src/main/java/AIPlayer.java +++ b/src/main/java/AIPlayer.java @@ -8,6 +8,7 @@ public class AIPlayer extends Player{ @Override public int choose(ArrayList usableFigures) { - return (int) (Math.random() * usableFigures.size()); + int res = (int) ((Math.random() * usableFigures.size())); + return usableFigures.get(res); } }