Goal of 8 Queens

On an 8 by 8 board, place 8 chess queens so that no queen attacks any other queen. A queen can attack horizontally, vertically, or diagonally.

Contest

Write an algorithm that will find a solution to the 8 queens problem.

Rules

There will be one queen in each column. The algorithm must decide the row that each queen should be in.

[edit]Since this problem lends itself to artifical intelligence, your intelligent agent cannot know anything else about the problem other than the definition. This means that it cannot know the solution. However, heuristics are allowed.[/edit]

The algorithm can place the queens on the board in the correct pattern or it can start with all the queens on the board and move them to the correct pattern. If the algorithm starts with the queens on the board, it must either use an algorithm to place them or start with the queens in random rows in each column.

Judging

I will add this later