From 33d3b77d53f5af2d65d35b54e020f58cce343a91 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Thu, 2 Dec 2021 00:17:24 +0200 Subject: [PATCH] Fix bug lol --- IDAstar.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDAstar.cs b/IDAstar.cs index 2e816ae..f912589 100644 --- a/IDAstar.cs +++ b/IDAstar.cs @@ -152,7 +152,7 @@ namespace IdaStar Point findPoint(CellState neededState) { for (var i = 0; i < _board.Count; i++) { for (var j = 0; j < _board[i].Count; j++) { - if (_board[i][j] == CellState.START) { + if (_board[i][j] == neededState) { return new(i, j); } } @@ -205,7 +205,7 @@ namespace IdaStar } var threshold = heuristic(startPoint, destinationPoint); - while (threshold == zero) { + while (threshold != zero) { threshold = search(startPoint, zero, threshold); } }