This code is an algorithm search and goal is when table is ordered from 1 to 16 (in first of game table is not ordered) . I want to have a delay when it fills UI Table (The table that show result of the game in UI), because i want to show the player the process of solving game by algorithm.
How can i have delay (1 or 2 seconds) in //Make Delay
?
public bool BFS_TreeSearch(int[,] table, Queue<int[,]> fringe)
{
MakeNode(table, fringe);
do
{
if (fringe.Count == 0)
return false;
int[,] node = fringe.Dequeue();
//Make Delay
FillTableUI(node);
if (isGoal(node))
return true;
MakeNode(node, fringe);
} while (true);
}