0
此代碼是一種算法搜索,目標是當表格從1到16排序時(遊戲中的第一個表格不是有序的)。我想在填充UI表(UI表中顯示遊戲結果的表)時有一個延遲,因爲我想向玩家展示按算法解決遊戲的過程。 我如何在//Make Delay
中有延遲(1或2秒)?在C中有時間延遲#
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);
}