Recursive solution for 8-queens
if (Column > 8) problem is solved;
while (unconsidered squares exist in the column and problem is unsolved)
{ determine next square that is not under attack by queen in an column;
if (such a square exists)
{ place queen; PlaceNextQueen(Column+1)
if (No queen is possible in column Column+1)
remove queen from column Column and consider next square in the column.