<P> Then, go through every element in the queue, including elements added to the end over the course of the algorithm, and to each element, do the following: </P> <Ol> <Li> Create a list of the four adjacent cells, with a counter variable of the current element's counter variable + 1 (in our example, the four cells are ((2, 8, 1), (3, 7, 1), (4, 8, 1), (3, 9, 1))) </Li> <Li> Check all cells in each list for the following two conditions: <Ol> <Li> If the cell is a wall, remove it from the list </Li> <Li> If there is an element in the main list with the same coordinate and a less than or equal counter, remove it from the cells list </Li> </Ol> </Li> <Li> Add all remaining cells in the list to the end of the main list </Li> <Li> Go to the next item in the list </Li> </Ol> <Li> Create a list of the four adjacent cells, with a counter variable of the current element's counter variable + 1 (in our example, the four cells are ((2, 8, 1), (3, 7, 1), (4, 8, 1), (3, 9, 1))) </Li> <Li> Check all cells in each list for the following two conditions: <Ol> <Li> If the cell is a wall, remove it from the list </Li> <Li> If there is an element in the main list with the same coordinate and a less than or equal counter, remove it from the cells list </Li> </Ol> </Li>

In the context of pathfinding define the start distance of a given state