From e1c93881afa5489cbb0d67255dcbec98826fcef1 Mon Sep 17 00:00:00 2001 From: Niklas Birk Date: Mon, 29 Jul 2024 21:56:08 +0200 Subject: [PATCH] Add some fun stuff --- test/search/GameHelperTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/search/GameHelperTest.java b/test/search/GameHelperTest.java index d4c5cf9..e7f03b1 100755 --- a/test/search/GameHelperTest.java +++ b/test/search/GameHelperTest.java @@ -7,6 +7,28 @@ import static search.SearchTestUtils.printSolution; public class GameHelperTest { + @Test + void shouldReturnCorrectTargetDemonologist() + { + final int[][] state = { + {8, 4 ,0}, + {6, 3, 1}, + {2, 5, 7} + }; + final var root = new EightPuzzleNode(state); + + final int[][] targetState = { + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 0} + }; + final var expected = new EightPuzzleNode(targetState); + + final var actual = new IterativeDeepening().iterativeDeepening(root, expected); + + printSolution(actual); + } + @Test void shouldReturnCorrectTargetWartales() {