Hello, right now I’m trying to figure out how to use search directions. I’m having a hard time trying to figure out how to use them with BFS
Hi,
What do you mean by “determine search directions”?
An algorithm is just a set of clear instructions. The BFS repeats the same steps over and over again until our final condition gets met. This means that we have to predefine the search directions. The order does not matter as long as it fits the logic of the algorithm.
We defined the directions and their order here:
Vector2Int[] directions = {
Vector2Int.right,
Vector2Int.left,
Vector2Int.up,
Vector2Int.down
};
Change the order of the directions to see what happens in your code.
1 Like
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.