Just wanted to check if somebody can correct the following pseudo code:

I was going through the the Algorithms Tutorial, Introduction to graphs and their data structures: Section 2, and I realized that the BFS pseudo-code might have a mistake:

Where it reads:

for (int player1XDelta = -1; player1XDelta <= -1; player1XDelta++) {

for (int player1YDelta = -1; player1YDelta <= -1; player1YDelta++) {

for (int player2XDelta = -1; player2XDelta <= -1; player2XDelta++) {

for (int player2YDelta = -1; player2YDelta <= -1; player2YDelta++) {

It should read:

for (int player1XDelta = -1; player1XDelta <= 1; player1XDelta++) {

for (int player1YDelta = -1; player1YDelta <= 1; player1YDelta++) {

for (int player2XDelta = -1; player2XDelta <= 1; player2XDelta++) {

for (int player2YDelta = -1; player2YDelta <= 1; player2YDelta++) {

I noticed that the explanation is correct (we should use a for loop from -1 to 1) but the pseudo-code right after that seems to have a mistake.

Thanks.

- JA -]]>