From dd03f81fedf25ead6c639611f7060066c9ea969c Mon Sep 17 00:00:00 2001 From: FelixKrull Date: Wed, 16 Feb 2022 09:43:09 +0100 Subject: [PATCH] Fix Checkdice --- src/main/java/Game.java | 2 +- src/test/java/GameTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/Game.java b/src/main/java/Game.java index 7d8e3e1..ed51b7b 100644 --- a/src/main/java/Game.java +++ b/src/main/java/Game.java @@ -72,7 +72,7 @@ public class Game { */ public boolean checkDice(int dice, Player p, int countRolls, Game g) { int figuresInBase = p.checkFigureInBase(p.figures); - if(countRolls >= 3) return false; + if(countRolls >= 3) return dice == 6; if(figuresInBase == 4) { return true; } else if (figuresInBase < 4) { diff --git a/src/test/java/GameTest.java b/src/test/java/GameTest.java index 656d705..a11362d 100644 --- a/src/test/java/GameTest.java +++ b/src/test/java/GameTest.java @@ -87,6 +87,12 @@ public class GameTest { 5, 1, true + ), + Arguments.of("Figures on Field - d: 6 - c: 1", + Arrays.asList(0, -1, -1, -1), + 6, + 3, + true ) ); }