From 5c0d4221b81376ba0fc02f383c5d847652af099c Mon Sep 17 00:00:00 2001 From: Steffen Helmke Date: Fri, 14 Jan 2022 16:17:20 +0100 Subject: [PATCH] 4gewinnt: added calcScore method --- src/main/java/de/tims/viergewinnt/ai/Logic.java | 4 ++++ src/test/java/de/tims/viergewinnt/ai/LogicTest.java | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/de/tims/viergewinnt/ai/Logic.java b/src/main/java/de/tims/viergewinnt/ai/Logic.java index 59104a3..dfad882 100644 --- a/src/main/java/de/tims/viergewinnt/ai/Logic.java +++ b/src/main/java/de/tims/viergewinnt/ai/Logic.java @@ -146,4 +146,8 @@ public class Logic { } return false; } + + public int calcScore(int[][] playfield, int player) { + return 0; + } } diff --git a/src/test/java/de/tims/viergewinnt/ai/LogicTest.java b/src/test/java/de/tims/viergewinnt/ai/LogicTest.java index e35cd8d..3e344c4 100644 --- a/src/test/java/de/tims/viergewinnt/ai/LogicTest.java +++ b/src/test/java/de/tims/viergewinnt/ai/LogicTest.java @@ -65,6 +65,17 @@ class LogicTest { assertEquals(expectedResult, realResult); } + @Test + void calcScoreTest() { + int[][] playfield = new int[6][6]; + int player = 1; + int expectedResult = 0; + + int realResult = testObj.calcScore(playfield, player); + + assertEquals(expectedResult, realResult); + } + private static Stream playfieldResults() { int[][] playfield1 = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},