for each row in the map
for each column in the row
if map[row][column].HasCritter()
map[row][colum].GetCritter().Move()
+-0-+ +-0-+ |AB | | BA| 0 0 => 0 0 | | | | +-0-+ +-0-+ In the above picture, the algorithm found A and moved it two spaces to the right. Next it will move B, but after that it will find A again and attempt to move it again.
moved field associated with each critter
for each row in the map
for each column in the row
if map[row][column].HasCritter()
map[row][colum].GetCritter().ResetMove()
for each row in the map
for each column in the row
if map[row][column].HasCritter() and map[row][colum].GetCritter.DidNotMove()
map[row][colum].GetCritter().Move()
0 1 2 3 4 5
Array: A B C D E F
Delete C
The array sould become
0 1 2 3 4
Array: A B D E F
struct NodeT {
dataType data;
NodeT * next;
};