From e8992f8b0651bb848908e933e8f831b9e91ac735 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Tue, 7 Dec 2021 10:39:43 +0200 Subject: [PATCH] Update threshold increasing --- IDAstar.cs | 4 ++-- labyrinth.txt | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/IDAstar.cs b/IDAstar.cs index f0c416d..e8a13f6 100644 --- a/IDAstar.cs +++ b/IDAstar.cs @@ -177,7 +177,7 @@ namespace IdaStar if (f > threshold) { return f; } - var min = f; + var min = int.MaxValue; foreach(var neighbour in current.GetNeighbours()) { if (!neighbour.IsInsideBox(_board.Count, _board[0].Count)) { @@ -218,7 +218,7 @@ namespace IdaStar threshold = 0; } else { - threshold++; + threshold = newThreshold; } } } diff --git a/labyrinth.txt b/labyrinth.txt index 16c9c72..2ebfc28 100644 --- a/labyrinth.txt +++ b/labyrinth.txt @@ -1,7 +1,7 @@ -#### ### -#S # -##### ## - -## #### # -# # # - ##F#### +####.###.. +#S....#... +#####.##.. +.......... +##.####..# +#..#.....# +..##F####.